SlideShare una empresa de Scribd logo
1 de 207
Descargar para leer sin conexión
Perl 5.14
  for pragmatists
5.14




       perlhist
5.14

- after 5.8, we had to wait 5 years for 5.10




                                               perlhist
5.14

- after 5.8, we had to wait 5 years for 5.10
- 5.12 came out 2 years after 5.10



                                               perlhist
5.14

- after 5.8, we had to wait 5 years for 5.10
- 5.12 came out 2 years after 5.10
- 5.14 came out 1 year after 5.12


                                               perlhist
5.14

- after 5.8, we had to wait 5 years for 5.10
- 5.12 came out 2 years after 5.10
- 5.14 came out 1 year after 5.12
- 5.16 will come 1 year from 5.14

                                               perlhist
5.14




       perlhist
5.14

- 5.10 was a huge set of changes (too many!)




                                               perlhist
5.14

- 5.10 was a huge set of changes (too many!)
- 5.12 was a lot smaller



                                               perlhist
5.14

- 5.10 was a huge set of changes (too many!)
- 5.12 was a lot smaller
- 5.14 is in between


                                               perlhist
5.14

- 5.10 was a huge set of changes (too many!)
- 5.12 was a lot smaller
- 5.14 is in between
- just right?

                                               perlhist
5.14 is a Mixed Bag




                  perl5140delta
5.14 is a Mixed Bag

- this talk isn’t just for beginners




                                       perl5140delta
5.14 is a Mixed Bag

- this talk isn’t just for beginners
- some of these changes are at the edges



                                           perl5140delta
5.14 is a Mixed Bag

- this talk isn’t just for beginners
- some of these changes are at the edges
- but they’re all practical


                                           perl5140delta
5.14 is a Mixed Bag

- this talk isn’t just for beginners
- some of these changes are at the edges
- but they’re all practical
- except for the ones that aren’t

                                           perl5140delta
By the way, 5.16...




                      perl5150delta
By the way, 5.16...

- ...and beyond are going to be interesting




                                          perl5150delta
By the way, 5.16...

- ...and beyond are going to be interesting
- stick around right here after the break and
  hear Jesse “Double Pumpking” Vincent talk
  about it



                                         perl5150delta
...and 5.10 is EOL




                     perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks




                                              perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks
- that’s now 5.14 and 5.12




                                              perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks
- that’s now 5.14 and 5.12
- we do security fixes for releases in last 3 years



                                                perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks
- that’s now 5.14 and 5.12
- we do security fixes for releases in last 3 years
- 5.10 was 2007; it gets no promise of support

                                                perlpolicy
...and 5.10 is EOL
- we accept critical bugfixes for 2 maint tracks
- that’s now 5.14 and 5.12
- we do security fixes for releases in last 3 years
- 5.10 was 2007; it gets no promise of support
- if you’re still on 5.8, you’re in the weeds
                                                perlpolicy
but enough about other versions
let’s talk about 5.14
First: A Warning




                   feature
First: A Warning

- 5.14 is backwards compatible




                                 feature
First: A Warning

- 5.14 is backwards compatible
- but has some new behaviors



                                 feature
First: A Warning

- 5.14 is backwards compatible
- but has some new behaviors
- they’re not all enabled by default; feature.pm


                                                   feature
First: A Warning

- 5.14 is backwards compatible
- but has some new behaviors
- they’re not all enabled by default; feature.pm
- no new feature.pm features in 5.14!

                                                   feature
First: A Warning

- 5.14 is backwards compatible
- but has some new behaviors
- they’re not all enabled by default; feature.pm
- no new feature.pm features in 5.14!
                                     I’m a perldoc
                                          ref!
                                                   feature
First: A Warning

- 5.14 is backwards compatible
- but has some new behaviors
- they’re not all enabled by default; feature.pm
- no new feature.pm features in 5.14!

                                                   feature
Stuff That’s Gone




                    perlsyn
Stuff That’s Gone
- modules deprecated in 5.12 are gone in 5.14




                                                perlsyn
Stuff That’s Gone
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN




                                                perlsyn
Stuff That’s Gone
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN
- do you care? no, because they are:



                                                perlsyn
Stuff That’s Gone
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN
- do you care? no, because they are:
  - Class::ISA


                                                perlsyn
Stuff That’s Gone
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN
- do you care? no, because they are:
  - Class::ISA
  - Pod::Plainer

                                                perlsyn
Stuff That’s Gone
- modules deprecated in 5.12 are gone in 5.14
- you’ll have to install them from CPAN
- do you care? no, because they are:
  - Class::ISA
  - Pod::Plainer
  - Switch
                                                perlsyn
Stuff That’s Going




                 Perl4::CoreLibs
Stuff That’s Going
- Devel::DProf
  - use Devel::NYTProf instead!
- the Perl 4 core
  - bigrat.pl, ftp.pl, etc
  - Perl4::CoreLibs
- Shell (again)
                                  Perl4::CoreLibs
:=




     attributes
:=

sub login : Local   { ... }




                              attributes
:=

sub login : Local   { ... }

my $x : Private = 10;




                              attributes
:=

sub login : Local   { ... }

my $x : Private = 10;

my $x := 10;




                              attributes
:=

sub login : Local   { ... }

my $x : Private = 10;

my $x := 10;




                              attributes
qw()


for my $show qw(Smallville Lost V)   {
  $tivo->cancel_pass( $show );
}




                                         perlop
qw()


for my $show (qw(Smallville Lost V)) {
  $tivo->cancel_pass( $show );
}




                                         perlop
That’s it!




             perl5140delta
That’s it!


- those are all the things being removed



                                           perl5140delta
That’s it!


- those are all the things being removed
- these are not scary removals


                                           perl5140delta
One More Thing!




                  perlsyn
One More Thing!


$str =~ m/foo/sand bar;




                          perlsyn
One More Thing!


$str =~ m/foo/sand bar;

$str =~ m/foo/s and bar;




                           perlsyn
New Regex Modifiers


my $hostname = get_hostname;

$hostname =~ s/..*//;




                               perlre
New Regex Modifiers


my $hostname = get_hostname =~ s/..*//;




                                           perlre
New Regex Modifiers


(my $hostname = get_hostname) =~ s/..*//;




                                         perlre
New Regex Modifiers


my $hostname = get_hostname =~ s/..*//r;




                                            perlre
New Regex Modifiers


my @short_names =
  map { s/..*//; } @long_names;




                                   perlre
New Regex Modifiers


my @short_names =
  map { s/..*//;
        $_ } @long_names;




                            perlre
New Regex Modifiers


my @short_names =
  map { my $x = $_;
        $x =~ s/..*//;
        $s } @long_names;




                            perlre
New Regex Modifiers


my @short_names =
  map { s/..*//r } @long_names;




                                   perlre
New Regex Modifiers


my @short_names =
  map s/..*//r, @long_names;




                                perlre
New Regex Modifiers
/u

/a

/aa

/l

/d




                            perlre
New Regex Modifiers




                      perllocale
New Regex Modifiers


/l - use locale rules




                         perllocale
New Regex Modifiers


/l - use locale rules

 YOU DON’T WANT THIS




                         perllocale
New Regex Modifiers




                      perlre
New Regex Modifiers

/u - use Unicode rules




                         perlre
New Regex Modifiers

/u - use Unicode rules

  d matches BENGALI DIGIT FOUR




                                  perlre
New Regex Modifiers

/u - use Unicode rules

  d matches BENGALI DIGIT FOUR

  w matches LATIN SMALL LETTER ETH




                                      perlre
New Regex Modifiers

/u - use Unicode rules

  d matches BENGALI DIGIT FOUR

  w matches LATIN SMALL LETTER ETH

  “N{LATIN SMALL LIGATURE FF}” =~ /ff/ui




                                        perlre
New Regex Modifiers

/a - Unicode, but ASCII rules for classes

  d rejects BENGALI DIGIT FOUR

  w rejects LATIN SMALL LETTER ETH

  “N{LATIN SMALL LIGATURE FF}” =~ /ff/ai




                                            perlre
New Regex Modifiers

/aa - Unicode, ASCII won’t match non-ASCII

  d rejects BENGALI DIGIT FOUR

  w rejects LATIN SMALL LETTER ETH

  “N{LATIN SMALL LIGATURE FF}” !~ /ff/aai




                                         perlre
New Regex Modifiers

/aa - Unicode, ASCII won’t match non-ASCII

  d rejects BENGALI DIGIT FOUR

  w rejects LATIN SMALL LETTER ETH

  “N{LATIN SMALL LIGATURE FF}” !~ /ff/aai


 “N{LATIN SMALL LIGATURE FF}” !~ /pL/aai


                                         perlre
New Regex Modifiers




                      perlre
New Regex Modifiers
/d - default semantics




                         perlre
New Regex Modifiers
/d - default semantics

Use Unicode if it’s seems like it’s




                                      perlre
New Regex Modifiers
/d - default semantics

Use Unicode if it’s seems like it’s
maybe kinda unicode or the pattern




                                      perlre
New Regex Modifiers
/d - default semantics

Use Unicode if it’s seems like it’s
maybe kinda unicode or the pattern
uses p or N{...}




                                      perlre
New Regex Modifiers
/d - default semantics

Use Unicode if it’s seems like it’s
maybe kinda unicode or the pattern
uses p or N{...}

Otherwise, on ASCII systems use ASCII




                                        perlre
New Regex Modifiers
/d - default semantics

Use Unicode if it’s seems like it’s
maybe kinda unicode or the pattern
uses p or N{...}

Otherwise, on ASCII systems use ASCII

Otherwise, on EBCDIC systems use Latin-1




                                           perlre
New Regex Modifiers
/d - duhhhh-derrrrr semantics

 Use Unicode if it’s seems like it’s
 maybe kinda unicode or the pattern
 uses p or N{...}

 Otherwise, on ASCII systems use ASCII

 Otherwise, on EBCDIC systems use Latin-1




                                            perlre
New Regex Modifiers

# To be really ASCII-only:

die “funny un-American characters”
  if $str =~ /[^x00-x7F]/;

$str =~ /...actual pattern.../;




                                     perlre
What should I do??
- Learn as much as you can!
- Seriously!
- Decode user input, use /aa, use p_
- Consider: use re ‘/aa’
- But mostly: learn more.
                                        perlunitut
New Regex Modifiers




                      perlre
New Regex Modifiers


$ perl-5.12.4 -E ‘say qr//’




                              perlre
New Regex Modifiers


$ perl-5.12.4 -E ‘say qr//’
(?-xism:)




                              perlre
New Regex Modifiers


$ perl-5.12.4 -E ‘say qr//’
(?-xism:)

$ perl-5.14.1 -E ‘say qr//’




                              perlre
New Regex Modifiers


$ perl-5.12.4 -E ‘say qr//’
(?-xism:)

$ perl-5.14.1 -E ‘say qr//’
(?^u:)




                              perlre
Perl is really good
  at Unicode.



                      perlunitut
Perl is really good
  at Unicode.
Unicode is just
 that complex.

                      perlunitut
More Unicode!


- ...well, as long as we’re on the subject...



                                                perlunitut
Unicode 6




            charnames
Unicode 6




            charnames
Unicode 6




            charnames
Unicode 6




            charnames
Unicode 6




            charnames
Unicode 6




            charnames
Unicode 6




            charnames
Unicode 6




            charnames
Unicode 6




            charnames
Unicode 6




            charnames
Unicode 6




            charnames
More Unicode!

- “unicode_strings” feature is improved
- N{...} understands abbreviations
- ...and you can make your own
- better support for surrogates and non-
  characters


                                           perlunitut
Container Improvements
Stuff From 5.12




                  perl5120delta
Stuff From 5.12

- local works more better




                            perl5120delta
Stuff From 5.12

- local works more better
- assigning to $[ gets a warning



                                   perl5120delta
Stuff From 5.12

- local works more better
- assigning to $[ gets a warning
- each works on arrays

                                   perl5120delta
That Stuff in 5.14




                     perl5140delta
That Stuff in 5.14

- local works even more betterer




                                   perl5140delta
That Stuff in 5.14

- local works even more betterer
- assigning to ($[) gets a warning



                                     perl5140delta
That Stuff in 5.14

- local works even more betterer
- assigning to ($[) gets a warning
- each works on arrayrefs

                                     perl5140delta
each on arrayrefs
my @array =   qw( foo bar baz )   ;

while (my ($k, $v) = each @array) {
  say “$k: $v”;
}




                                      perlfunc
each on arrayrefs
my @array =   qw( foo bar baz )   ;

while (my ($k, $v) = each @array) {
  say “$k: $v”;
}



0: foo
1: bar
2: baz


                                      perlfunc
each on arrayrefs
my $array = [ qw( foo bar baz ) ];

while (my ($k, $v) = each $array) {
  say “$k: $v”;
}



0: foo
1: bar
2: baz


                                      perlfunc
each on arrayrefs




                    perlfunc
each on arrayrefs


my ($x, $y) = each @{ $h->{foo}[1] }




                                       perlfunc
each on arrayrefs


my ($x, $y) = each @{ $h->{foo}[1] }

my ($x, $y) = each   $h->{foo}[1]




                                       perlfunc
AVOID
each @array
built-ins on references




                          perlfunc
built-ins on references
push $arrayref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift   $arrayref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift   $arrayref
unshift $arrayref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift   $arrayref
unshift $arrayref
splice $arrayref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift   $arrayref
unshift $arrayref
splice $arrayref

keys   $arrayref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift   $arrayref
unshift $arrayref
splice $arrayref

keys   $arrayref
values $arrayref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift   $arrayref
unshift $arrayref
splice $arrayref

keys   $arrayref
values $arrayref
each   $arrayref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift   $arrayref
unshift $arrayref
splice $arrayref

keys   $arrayref
values $arrayref
each   $arrayref

keys   $hashref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift   $arrayref
unshift $arrayref
splice $arrayref

keys   $arrayref
values $arrayref
each   $arrayref

keys   $hashref
values $hashref




                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift   $arrayref
unshift $arrayref
splice $arrayref

keys   $arrayref
values $arrayref
each   $arrayref

keys   $hashref
values $hashref
each   $hashref



                             perlfunc
built-ins on references
push $arrayref
pop $arrayref
shift
             AL
        $arrayref

            T
          N
unshift $arrayref


keys
      I  E
splice $arrayref


        M
       $arrayref



   P
each
    ER
values $arrayref
       $arrayref


EX
keys

each
       $hashref
values $hashref
       $hashref



                             perlfunc
built-ins on references




                          perlfunc
built-ins on references

sub demo (+$) {




                             perlfunc
built-ins on references

sub demo (+$) {
  my ($x, $y) = @_;




                             perlfunc
built-ins on references

sub demo (+$) {
  my ($x, $y) = @_;
  # do stuff




                             perlfunc
built-ins on references

sub demo (+$) {
  my ($x, $y) = @_;
  # do stuff
}




                             perlfunc
built-ins on references

sub demo (+$) {
  my ($x, $y) = @_;
  # do stuff
}

demo( @array, $n );




                             perlfunc
built-ins on references

sub demo (+$) {
  my ($x, $y) = @_;
  # do stuff
}

demo( @array, $n );
demo(@array, $n );




                             perlfunc
built-ins on references

sub demo (+$) {
  my ($x, $y) = @_;
  # do stuff
}

demo( @array, $n );
demo(@array, $n );
demo( %hash, $n );




                             perlfunc
built-ins on references

sub demo (+$) {
  my ($x, $y) = @_;
  # do stuff
}

demo( @array,   $n   );
demo(@array,   $n   );
demo( %hash,    $n   );
demo(%hash,    $n   );




                             perlfunc
Package Blocks

package Library::Awesome;
our $VERSION = 1.234;

sub foo { ... }

1;




                            perlfunc
Package Blocks

package Library::Awesome 1.234 {

    sub foo { ... }

}

1;




                                   perlfunc
Package Blocks

package Library::Awesome 1.234 {

    sub foo { ... }

}

1;




                                   perlfunc
Package Blocks

package Library::Awesome 0.2-1alpha {

    sub foo { ... }

}

1;




                                        perlfunc
Package Blocks

package Library::Awesome 1.234;

sub foo { ... }

1;




                                  perlfunc
Speaking of Packages




                   perlmodlib
Speaking of Packages


- Perl 5.14 removed a bunch of modules



                                         perlmodlib
Speaking of Packages


- Perl 5.14 removed a bunch of modules
- ...so there was room to add new ones!


                                          perlmodlib
HTTP::Tiny

use 5.14.0;
use HTTP::Tiny;

my $http = HTTP::Tiny->new;
my $res = $http->get( $url );

print $res->{content} if $res->{success};




                                     HTTP::Tiny
JSON::PP

use JSON::PP;

my $data = decode_json( $json_string );

my $json = encode_json( $data_struct );




                                          JSON::PP
JSON::PP
use 5.14.0;




              JSON::PP
use 5.14.0;
use autodie;




               JSON::PP
use 5.14.0;
use autodie;
use HTTP::Tiny;




                  JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;




                    JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;




                                                JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;




                                                JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;
my $json = $http->get( $moose );




                                                JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;
my $json = $http->get( $moose );
die $json->{reason} unless $json->{success};




                                                JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;
my $json = $http->get( $moose );
die $json->{reason} unless $json->{success};

my $dist = decode_json( $json );




                                                JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;
my $json = $http->get( $moose );
die $json->{reason} unless $json->{success};

my $dist = decode_json( $json );

my $tgz   = $http->get( $json->{download_url} );




                                                   JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;
my $json = $http->get( $moose );
die $json->{reason} unless $json->{success};

my $dist = decode_json( $json );

my $tgz = $http->get( $json->{download_url} );
die $tgz->{reason} unless $tgz->{success};




                                                 JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;
my $json = $http->get( $moose );
die $json->{reason} unless $json->{success};

my $dist = decode_json( $json );

my $tgz = $http->get( $json->{download_url} );
die $tgz->{reason} unless $tgz->{success};

open my $fh, ‘>’, $dist->{archive};




                                                 JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;
my $json = $http->get( $moose );
die $json->{reason} unless $json->{success};

my $dist = decode_json( $json );

my $tgz = $http->get( $json->{download_url} );
die $tgz->{reason} unless $tgz->{success};

open my $fh, ‘>’, $dist->{archive};

$fh->print( $tgz->{content} );



                                                 JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;
my $json = $http->get( $moose );
die $json->{reason} unless $json->{success};

my $dist = decode_json( $json );

my $tgz = $http->get( $json->{download_url} );
die $tgz->{reason} unless $tgz->{success};

open my $fh, ‘>’, $dist->{archive};

$fh->print( $tgz->{content} );
$fh->close;


                                                 JSON::PP
use   5.14.0;
use   autodie;
use   HTTP::Tiny;
use   JSON::PP;

my $moose = ‘http://api.metacpan.org/release/Moose’;

my $http = HTTP::Tiny->new;
my $json = $http->get( $moose );
die $json->{reason} unless $json->{success};

my $dist = decode_json( $json );

my $tgz = $http->get( $json->{download_url} );
die $tgz->{reason} unless $tgz->{success};

open my $fh, ‘>’, $dist->{archive};

$fh->print( $tgz->{content} );
$fh->close;


                                                  IO::File
IO::File

open my $fh, ‘<’, $some_filename
  or die “can’t open fh: $!”;

print {$fh} “Some output.”;

close $fh or die “can’t close fh: $!”;




                                         perlopentut
IO::File
use 5.10.1;
use autodie;


open my $fh, ‘>’, $some_filename;


print {$fh} “Some output.”;

close $fh;




                                    autodie
IO::File
use 5.10.1;
use autodie;
use IO::File;

open my $fh, ‘>’, $some_filename;


$fh->print( “Some output.” );

$fh->close;




                                    IO::File
IO::File
use 5.14.0;
use autodie;
use IO::File;

open my $fh, ‘>’, $some_filename;


$fh->print( “Some output.” );

$fh->close;




                                    IO::File
IO::File
use 5.14.0;
use autodie;


open my $fh, ‘>’, $some_filename;


$fh->print( “Some output.” );

$fh->close;




                                    IO::File
IO::File
use 5.14.0;
use autodie;


open my $fh, ‘>’, $some_filename;


$fh->print( “Some output.” );

$fh->close or die “can’t close: $!”;




                                       IO::File
$@

     perlvar
$@




     Try::Tiny
$@

- Well, actually, you use Try::Tiny, right?




                                              Try::Tiny
$@

- Well, actually, you use Try::Tiny, right?
- But this makes Try::Tiny more reliable, too!



                                             Try::Tiny
$@

- Well, actually, you use Try::Tiny, right?
- But this makes Try::Tiny more reliable, too!
- You see, eval and $@ are totally awful

                                             Try::Tiny
use 5.12.0;

{
    package X;
    sub DESTROY { eval { } }
}

eval {
  my $x = bless {} => ‘X’;
  die “DEATH!!”;
};

warn “ERROR: $@”;




                               perlfunc
use 5.12.0;

{
    package X;
    sub DESTROY { eval { } }
}

eval {
  my $x = bless {} => ‘X’;
  die “DEATH!!”;
};

warn “ERROR: $@”;




$ perl5.12.4 test.pl
ERROR:


                               perlfunc
use 5.14.0;

{
    package X;
    sub DESTROY { eval { } }
}

eval {
  my $x = bless {} => ‘X’;
  die “DEATH!!”;
};

warn “ERROR: $@”;




                               perlfunc
use 5.14.0;

{
    package X;
    sub DESTROY { eval { } }
}

eval {
  my $x = bless {} => ‘X’;
  die “DEATH!!”;
};

warn “ERROR: $@”;




$ perl5.14.1 test.pl
ERROR: DEATH!!


                               perlfunc
IPv6 Support!




                Socket
IPv6 Support!

- IPv4 is getting pretty old




                               Socket
IPv6 Support!

- IPv4 is getting pretty old
- not a big deal



                               Socket
IPv6 Support!

- IPv4 is getting pretty old
- not a big deal
- won’t run out of addresses until 2011-04-15


                                                Socket
IPv6 Support!

- IPv4 is getting pretty old
- not a big deal
- won’t run out of addresses until 2011-04-15
- …the future!

                                                Socket
More Random Stuff
say “I o{23145} Perl 5.14!”;




                                perlsyn
say “I o{23145} Perl 5.14!”;




I   Perl 5.14!


                                perlsyn
say “I 23145 Perl 5.14!”;




I ?45 Perl 5.14!


                             perlsyn
say “I 023145 Perl 5.14!”;




I 145 Perl 5.14!


                              perlsyn
# Pretend there are 15 captures:
qr{
  (1) (2) (3) (4)     7 10
  (5) (6) (7) (8) (9) 7 10
  (10)                7 10
}x;




                                   perlre
# Pretend there are 15 captures:
qr{
  (1) (2) (3) (4)     o{7} o{10}
  (5) (6) (7) (8) (9) o{7} o{10}
  (10)                g{7} g{10}
}x;




                                     perlre
my @hex = (0x0D,   0x0A);
my @bin = (0b1101, 0b1010);




                              perlsyn
my @hex = (0x0D,   0x0A);
my @bin = (0b1101, 0b1010);




my @hex = (0X0D,   0X0A);
my @bin = (0B1101, 0B1010);




                              perlsyn
printf “%hhun”, 10;

printf “%tun”, 10;

printf “%zun”, 10;




                       perlfunc
printf “%hhun”, 10; # char

printf “%tun”, 10;   # ptrdiff_t

printf “%zun”, 10;   # size_t




                                    perlfunc
0.0416303447718782




                     perlfunc
perl -E ‘srand(1); say rand;’




                                perlfunc
my $seed = srand;




                    perlfunc
http://www.perl.org/get.html
Any questions?

Más contenido relacionado

Similar a Perl 5.14 for Pragmatists

Perl 5.10 for People Who Aren't Totally Insane
Perl 5.10 for People Who Aren't Totally InsanePerl 5.10 for People Who Aren't Totally Insane
Perl 5.10 for People Who Aren't Totally InsaneRicardo Signes
 
Old Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This CenturyOld Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This CenturyJohn Anderson
 
Whatsnew in-perl
Whatsnew in-perlWhatsnew in-perl
Whatsnew in-perldaoswald
 
Perl 5.16 and Beyond - YAPC::Asia 2011
Perl 5.16 and Beyond - YAPC::Asia 2011Perl 5.16 and Beyond - YAPC::Asia 2011
Perl 5.16 and Beyond - YAPC::Asia 2011Jesse Vincent
 
Perl 5.16 and beyond
Perl 5.16 and beyondPerl 5.16 and beyond
Perl 5.16 and beyondJesse Vincent
 
Old Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyOld Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyAll Things Open
 
Old Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyOld Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyJohn Anderson
 
What's new in Perl 5.14
What's new in Perl 5.14What's new in Perl 5.14
What's new in Perl 5.14Andrew Shitov
 
Perl 5: Today, Tomorrow, and Christmas
Perl 5: Today, Tomorrow, and ChristmasPerl 5: Today, Tomorrow, and Christmas
Perl 5: Today, Tomorrow, and ChristmasRicardo Signes
 
Perl 5.12 for Everyday Use
Perl 5.12 for Everyday UsePerl 5.12 for Everyday Use
Perl 5.12 for Everyday UseRicardo Signes
 
The top 5 JavaScript issues in all our codebases
The top 5 JavaScript issues in all our codebasesThe top 5 JavaScript issues in all our codebases
The top 5 JavaScript issues in all our codebasesPhil Nash
 
Yapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlYapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlBruce Gray
 
Carton
CartonCarton
Cartontaggg
 
Perlの現在と未来 2010
Perlの現在と未来 2010Perlの現在と未来 2010
Perlの現在と未来 2010lestrrat
 
What's new in Perl 5.10?
What's new in Perl 5.10?What's new in Perl 5.10?
What's new in Perl 5.10?acme
 

Similar a Perl 5.14 for Pragmatists (20)

Perl 5.10 for People Who Aren't Totally Insane
Perl 5.10 for People Who Aren't Totally InsanePerl 5.10 for People Who Aren't Totally Insane
Perl 5.10 for People Who Aren't Totally Insane
 
Old Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This CenturyOld Dogs & New Tricks: What's New With Perl5 This Century
Old Dogs & New Tricks: What's New With Perl5 This Century
 
Whatsnew in-perl
Whatsnew in-perlWhatsnew in-perl
Whatsnew in-perl
 
Perl 5.16 and Beyond - YAPC::Asia 2011
Perl 5.16 and Beyond - YAPC::Asia 2011Perl 5.16 and Beyond - YAPC::Asia 2011
Perl 5.16 and Beyond - YAPC::Asia 2011
 
Perl 5.16 and beyond
Perl 5.16 and beyondPerl 5.16 and beyond
Perl 5.16 and beyond
 
Old Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyOld Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This Century
 
Old Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This CenturyOld Dogs & New Tricks: What's New with Perl5 This Century
Old Dogs & New Tricks: What's New with Perl5 This Century
 
What's new in Perl 5.14
What's new in Perl 5.14What's new in Perl 5.14
What's new in Perl 5.14
 
Perl 5.10 in 2010
Perl 5.10 in 2010Perl 5.10 in 2010
Perl 5.10 in 2010
 
Perl 5: Today, Tomorrow, and Christmas
Perl 5: Today, Tomorrow, and ChristmasPerl 5: Today, Tomorrow, and Christmas
Perl 5: Today, Tomorrow, and Christmas
 
Perl Moderno
Perl ModernoPerl Moderno
Perl Moderno
 
Perl 5.12 for Everyday Use
Perl 5.12 for Everyday UsePerl 5.12 for Everyday Use
Perl 5.12 for Everyday Use
 
The top 5 JavaScript issues in all our codebases
The top 5 JavaScript issues in all our codebasesThe top 5 JavaScript issues in all our codebases
The top 5 JavaScript issues in all our codebases
 
Perlbrew
PerlbrewPerlbrew
Perlbrew
 
Yapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlYapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line Perl
 
perl
perlperl
perl
 
Carton
CartonCarton
Carton
 
Perlの現在と未来 2010
Perlの現在と未来 2010Perlの現在と未来 2010
Perlの現在と未来 2010
 
What's new in Perl 5.10?
What's new in Perl 5.10?What's new in Perl 5.10?
What's new in Perl 5.10?
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 

Más de Ricardo Signes

What's New in Perl? v5.10 - v5.16
What's New in Perl?  v5.10 - v5.16What's New in Perl?  v5.10 - v5.16
What's New in Perl? v5.10 - v5.16Ricardo Signes
 
Dist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN DistributionsDist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN DistributionsRicardo Signes
 
Antediluvian Unix: A Guide to Unix Fundamentals
Antediluvian Unix: A Guide to Unix FundamentalsAntediluvian Unix: A Guide to Unix Fundamentals
Antediluvian Unix: A Guide to Unix FundamentalsRicardo Signes
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdRicardo Signes
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterRicardo Signes
 
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!Ricardo Signes
 

Más de Ricardo Signes (8)

What's New in Perl? v5.10 - v5.16
What's New in Perl?  v5.10 - v5.16What's New in Perl?  v5.10 - v5.16
What's New in Perl? v5.10 - v5.16
 
Dist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN DistributionsDist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN Distributions
 
i &lt;3 email
i &lt;3 emaili &lt;3 email
i &lt;3 email
 
Dist::Zilla
Dist::ZillaDist::Zilla
Dist::Zilla
 
Antediluvian Unix: A Guide to Unix Fundamentals
Antediluvian Unix: A Guide to Unix FundamentalsAntediluvian Unix: A Guide to Unix Fundamentals
Antediluvian Unix: A Guide to Unix Fundamentals
 
Writing Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::CmdWriting Modular Command-line Apps with App::Cmd
Writing Modular Command-line Apps with App::Cmd
 
Crafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::ExporterCrafting Custom Interfaces with Sub::Exporter
Crafting Custom Interfaces with Sub::Exporter
 
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
How I Learned to Stop Worrying and Love Email::: The 2007 PEP Talk!!
 

Último

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Último (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Perl 5.14 for Pragmatists

  • 1. Perl 5.14 for pragmatists
  • 2. 5.14 perlhist
  • 3. 5.14 - after 5.8, we had to wait 5 years for 5.10 perlhist
  • 4. 5.14 - after 5.8, we had to wait 5 years for 5.10 - 5.12 came out 2 years after 5.10 perlhist
  • 5. 5.14 - after 5.8, we had to wait 5 years for 5.10 - 5.12 came out 2 years after 5.10 - 5.14 came out 1 year after 5.12 perlhist
  • 6. 5.14 - after 5.8, we had to wait 5 years for 5.10 - 5.12 came out 2 years after 5.10 - 5.14 came out 1 year after 5.12 - 5.16 will come 1 year from 5.14 perlhist
  • 7. 5.14 perlhist
  • 8. 5.14 - 5.10 was a huge set of changes (too many!) perlhist
  • 9. 5.14 - 5.10 was a huge set of changes (too many!) - 5.12 was a lot smaller perlhist
  • 10. 5.14 - 5.10 was a huge set of changes (too many!) - 5.12 was a lot smaller - 5.14 is in between perlhist
  • 11. 5.14 - 5.10 was a huge set of changes (too many!) - 5.12 was a lot smaller - 5.14 is in between - just right? perlhist
  • 12. 5.14 is a Mixed Bag perl5140delta
  • 13. 5.14 is a Mixed Bag - this talk isn’t just for beginners perl5140delta
  • 14. 5.14 is a Mixed Bag - this talk isn’t just for beginners - some of these changes are at the edges perl5140delta
  • 15. 5.14 is a Mixed Bag - this talk isn’t just for beginners - some of these changes are at the edges - but they’re all practical perl5140delta
  • 16. 5.14 is a Mixed Bag - this talk isn’t just for beginners - some of these changes are at the edges - but they’re all practical - except for the ones that aren’t perl5140delta
  • 17. By the way, 5.16... perl5150delta
  • 18. By the way, 5.16... - ...and beyond are going to be interesting perl5150delta
  • 19. By the way, 5.16... - ...and beyond are going to be interesting - stick around right here after the break and hear Jesse “Double Pumpking” Vincent talk about it perl5150delta
  • 20. ...and 5.10 is EOL perlpolicy
  • 21. ...and 5.10 is EOL - we accept critical bugfixes for 2 maint tracks perlpolicy
  • 22. ...and 5.10 is EOL - we accept critical bugfixes for 2 maint tracks - that’s now 5.14 and 5.12 perlpolicy
  • 23. ...and 5.10 is EOL - we accept critical bugfixes for 2 maint tracks - that’s now 5.14 and 5.12 - we do security fixes for releases in last 3 years perlpolicy
  • 24. ...and 5.10 is EOL - we accept critical bugfixes for 2 maint tracks - that’s now 5.14 and 5.12 - we do security fixes for releases in last 3 years - 5.10 was 2007; it gets no promise of support perlpolicy
  • 25. ...and 5.10 is EOL - we accept critical bugfixes for 2 maint tracks - that’s now 5.14 and 5.12 - we do security fixes for releases in last 3 years - 5.10 was 2007; it gets no promise of support - if you’re still on 5.8, you’re in the weeds perlpolicy
  • 26. but enough about other versions
  • 28. First: A Warning feature
  • 29. First: A Warning - 5.14 is backwards compatible feature
  • 30. First: A Warning - 5.14 is backwards compatible - but has some new behaviors feature
  • 31. First: A Warning - 5.14 is backwards compatible - but has some new behaviors - they’re not all enabled by default; feature.pm feature
  • 32. First: A Warning - 5.14 is backwards compatible - but has some new behaviors - they’re not all enabled by default; feature.pm - no new feature.pm features in 5.14! feature
  • 33. First: A Warning - 5.14 is backwards compatible - but has some new behaviors - they’re not all enabled by default; feature.pm - no new feature.pm features in 5.14! I’m a perldoc ref! feature
  • 34. First: A Warning - 5.14 is backwards compatible - but has some new behaviors - they’re not all enabled by default; feature.pm - no new feature.pm features in 5.14! feature
  • 36. Stuff That’s Gone - modules deprecated in 5.12 are gone in 5.14 perlsyn
  • 37. Stuff That’s Gone - modules deprecated in 5.12 are gone in 5.14 - you’ll have to install them from CPAN perlsyn
  • 38. Stuff That’s Gone - modules deprecated in 5.12 are gone in 5.14 - you’ll have to install them from CPAN - do you care? no, because they are: perlsyn
  • 39. Stuff That’s Gone - modules deprecated in 5.12 are gone in 5.14 - you’ll have to install them from CPAN - do you care? no, because they are: - Class::ISA perlsyn
  • 40. Stuff That’s Gone - modules deprecated in 5.12 are gone in 5.14 - you’ll have to install them from CPAN - do you care? no, because they are: - Class::ISA - Pod::Plainer perlsyn
  • 41. Stuff That’s Gone - modules deprecated in 5.12 are gone in 5.14 - you’ll have to install them from CPAN - do you care? no, because they are: - Class::ISA - Pod::Plainer - Switch perlsyn
  • 42. Stuff That’s Going Perl4::CoreLibs
  • 43. Stuff That’s Going - Devel::DProf - use Devel::NYTProf instead! - the Perl 4 core - bigrat.pl, ftp.pl, etc - Perl4::CoreLibs - Shell (again) Perl4::CoreLibs
  • 44. := attributes
  • 45. := sub login : Local { ... } attributes
  • 46. := sub login : Local { ... } my $x : Private = 10; attributes
  • 47. := sub login : Local { ... } my $x : Private = 10; my $x := 10; attributes
  • 48. := sub login : Local { ... } my $x : Private = 10; my $x := 10; attributes
  • 49. qw() for my $show qw(Smallville Lost V) { $tivo->cancel_pass( $show ); } perlop
  • 50. qw() for my $show (qw(Smallville Lost V)) { $tivo->cancel_pass( $show ); } perlop
  • 51. That’s it! perl5140delta
  • 52. That’s it! - those are all the things being removed perl5140delta
  • 53. That’s it! - those are all the things being removed - these are not scary removals perl5140delta
  • 54. One More Thing! perlsyn
  • 55. One More Thing! $str =~ m/foo/sand bar; perlsyn
  • 56. One More Thing! $str =~ m/foo/sand bar; $str =~ m/foo/s and bar; perlsyn
  • 57. New Regex Modifiers my $hostname = get_hostname; $hostname =~ s/..*//; perlre
  • 58. New Regex Modifiers my $hostname = get_hostname =~ s/..*//; perlre
  • 59. New Regex Modifiers (my $hostname = get_hostname) =~ s/..*//; perlre
  • 60. New Regex Modifiers my $hostname = get_hostname =~ s/..*//r; perlre
  • 61. New Regex Modifiers my @short_names = map { s/..*//; } @long_names; perlre
  • 62. New Regex Modifiers my @short_names = map { s/..*//; $_ } @long_names; perlre
  • 63. New Regex Modifiers my @short_names = map { my $x = $_; $x =~ s/..*//; $s } @long_names; perlre
  • 64. New Regex Modifiers my @short_names = map { s/..*//r } @long_names; perlre
  • 65. New Regex Modifiers my @short_names = map s/..*//r, @long_names; perlre
  • 67. New Regex Modifiers perllocale
  • 68. New Regex Modifiers /l - use locale rules perllocale
  • 69. New Regex Modifiers /l - use locale rules YOU DON’T WANT THIS perllocale
  • 71. New Regex Modifiers /u - use Unicode rules perlre
  • 72. New Regex Modifiers /u - use Unicode rules d matches BENGALI DIGIT FOUR perlre
  • 73. New Regex Modifiers /u - use Unicode rules d matches BENGALI DIGIT FOUR w matches LATIN SMALL LETTER ETH perlre
  • 74. New Regex Modifiers /u - use Unicode rules d matches BENGALI DIGIT FOUR w matches LATIN SMALL LETTER ETH “N{LATIN SMALL LIGATURE FF}” =~ /ff/ui perlre
  • 75. New Regex Modifiers /a - Unicode, but ASCII rules for classes d rejects BENGALI DIGIT FOUR w rejects LATIN SMALL LETTER ETH “N{LATIN SMALL LIGATURE FF}” =~ /ff/ai perlre
  • 76. New Regex Modifiers /aa - Unicode, ASCII won’t match non-ASCII d rejects BENGALI DIGIT FOUR w rejects LATIN SMALL LETTER ETH “N{LATIN SMALL LIGATURE FF}” !~ /ff/aai perlre
  • 77. New Regex Modifiers /aa - Unicode, ASCII won’t match non-ASCII d rejects BENGALI DIGIT FOUR w rejects LATIN SMALL LETTER ETH “N{LATIN SMALL LIGATURE FF}” !~ /ff/aai “N{LATIN SMALL LIGATURE FF}” !~ /pL/aai perlre
  • 79. New Regex Modifiers /d - default semantics perlre
  • 80. New Regex Modifiers /d - default semantics Use Unicode if it’s seems like it’s perlre
  • 81. New Regex Modifiers /d - default semantics Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern perlre
  • 82. New Regex Modifiers /d - default semantics Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern uses p or N{...} perlre
  • 83. New Regex Modifiers /d - default semantics Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern uses p or N{...} Otherwise, on ASCII systems use ASCII perlre
  • 84. New Regex Modifiers /d - default semantics Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern uses p or N{...} Otherwise, on ASCII systems use ASCII Otherwise, on EBCDIC systems use Latin-1 perlre
  • 85. New Regex Modifiers /d - duhhhh-derrrrr semantics Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern uses p or N{...} Otherwise, on ASCII systems use ASCII Otherwise, on EBCDIC systems use Latin-1 perlre
  • 86. New Regex Modifiers # To be really ASCII-only: die “funny un-American characters” if $str =~ /[^x00-x7F]/; $str =~ /...actual pattern.../; perlre
  • 87. What should I do?? - Learn as much as you can! - Seriously! - Decode user input, use /aa, use p_ - Consider: use re ‘/aa’ - But mostly: learn more. perlunitut
  • 89. New Regex Modifiers $ perl-5.12.4 -E ‘say qr//’ perlre
  • 90. New Regex Modifiers $ perl-5.12.4 -E ‘say qr//’ (?-xism:) perlre
  • 91. New Regex Modifiers $ perl-5.12.4 -E ‘say qr//’ (?-xism:) $ perl-5.14.1 -E ‘say qr//’ perlre
  • 92. New Regex Modifiers $ perl-5.12.4 -E ‘say qr//’ (?-xism:) $ perl-5.14.1 -E ‘say qr//’ (?^u:) perlre
  • 93. Perl is really good at Unicode. perlunitut
  • 94. Perl is really good at Unicode. Unicode is just that complex. perlunitut
  • 95. More Unicode! - ...well, as long as we’re on the subject... perlunitut
  • 96. Unicode 6 charnames
  • 97. Unicode 6 charnames
  • 98. Unicode 6 charnames
  • 99. Unicode 6 charnames
  • 100. Unicode 6 charnames
  • 101. Unicode 6 charnames
  • 102. Unicode 6 charnames
  • 103. Unicode 6 charnames
  • 104. Unicode 6 charnames
  • 105. Unicode 6 charnames
  • 106. Unicode 6 charnames
  • 107. More Unicode! - “unicode_strings” feature is improved - N{...} understands abbreviations - ...and you can make your own - better support for surrogates and non- characters perlunitut
  • 109. Stuff From 5.12 perl5120delta
  • 110. Stuff From 5.12 - local works more better perl5120delta
  • 111. Stuff From 5.12 - local works more better - assigning to $[ gets a warning perl5120delta
  • 112. Stuff From 5.12 - local works more better - assigning to $[ gets a warning - each works on arrays perl5120delta
  • 113. That Stuff in 5.14 perl5140delta
  • 114. That Stuff in 5.14 - local works even more betterer perl5140delta
  • 115. That Stuff in 5.14 - local works even more betterer - assigning to ($[) gets a warning perl5140delta
  • 116. That Stuff in 5.14 - local works even more betterer - assigning to ($[) gets a warning - each works on arrayrefs perl5140delta
  • 117. each on arrayrefs my @array = qw( foo bar baz ) ; while (my ($k, $v) = each @array) { say “$k: $v”; } perlfunc
  • 118. each on arrayrefs my @array = qw( foo bar baz ) ; while (my ($k, $v) = each @array) { say “$k: $v”; } 0: foo 1: bar 2: baz perlfunc
  • 119. each on arrayrefs my $array = [ qw( foo bar baz ) ]; while (my ($k, $v) = each $array) { say “$k: $v”; } 0: foo 1: bar 2: baz perlfunc
  • 120. each on arrayrefs perlfunc
  • 121. each on arrayrefs my ($x, $y) = each @{ $h->{foo}[1] } perlfunc
  • 122. each on arrayrefs my ($x, $y) = each @{ $h->{foo}[1] } my ($x, $y) = each $h->{foo}[1] perlfunc
  • 125. built-ins on references push $arrayref perlfunc
  • 126. built-ins on references push $arrayref pop $arrayref perlfunc
  • 127. built-ins on references push $arrayref pop $arrayref shift $arrayref perlfunc
  • 128. built-ins on references push $arrayref pop $arrayref shift $arrayref unshift $arrayref perlfunc
  • 129. built-ins on references push $arrayref pop $arrayref shift $arrayref unshift $arrayref splice $arrayref perlfunc
  • 130. built-ins on references push $arrayref pop $arrayref shift $arrayref unshift $arrayref splice $arrayref keys $arrayref perlfunc
  • 131. built-ins on references push $arrayref pop $arrayref shift $arrayref unshift $arrayref splice $arrayref keys $arrayref values $arrayref perlfunc
  • 132. built-ins on references push $arrayref pop $arrayref shift $arrayref unshift $arrayref splice $arrayref keys $arrayref values $arrayref each $arrayref perlfunc
  • 133. built-ins on references push $arrayref pop $arrayref shift $arrayref unshift $arrayref splice $arrayref keys $arrayref values $arrayref each $arrayref keys $hashref perlfunc
  • 134. built-ins on references push $arrayref pop $arrayref shift $arrayref unshift $arrayref splice $arrayref keys $arrayref values $arrayref each $arrayref keys $hashref values $hashref perlfunc
  • 135. built-ins on references push $arrayref pop $arrayref shift $arrayref unshift $arrayref splice $arrayref keys $arrayref values $arrayref each $arrayref keys $hashref values $hashref each $hashref perlfunc
  • 136. built-ins on references push $arrayref pop $arrayref shift AL $arrayref T N unshift $arrayref keys I E splice $arrayref M $arrayref P each ER values $arrayref $arrayref EX keys each $hashref values $hashref $hashref perlfunc
  • 138. built-ins on references sub demo (+$) { perlfunc
  • 139. built-ins on references sub demo (+$) { my ($x, $y) = @_; perlfunc
  • 140. built-ins on references sub demo (+$) { my ($x, $y) = @_; # do stuff perlfunc
  • 141. built-ins on references sub demo (+$) { my ($x, $y) = @_; # do stuff } perlfunc
  • 142. built-ins on references sub demo (+$) { my ($x, $y) = @_; # do stuff } demo( @array, $n ); perlfunc
  • 143. built-ins on references sub demo (+$) { my ($x, $y) = @_; # do stuff } demo( @array, $n ); demo(@array, $n ); perlfunc
  • 144. built-ins on references sub demo (+$) { my ($x, $y) = @_; # do stuff } demo( @array, $n ); demo(@array, $n ); demo( %hash, $n ); perlfunc
  • 145. built-ins on references sub demo (+$) { my ($x, $y) = @_; # do stuff } demo( @array, $n ); demo(@array, $n ); demo( %hash, $n ); demo(%hash, $n ); perlfunc
  • 146. Package Blocks package Library::Awesome; our $VERSION = 1.234; sub foo { ... } 1; perlfunc
  • 147. Package Blocks package Library::Awesome 1.234 { sub foo { ... } } 1; perlfunc
  • 148. Package Blocks package Library::Awesome 1.234 { sub foo { ... } } 1; perlfunc
  • 149. Package Blocks package Library::Awesome 0.2-1alpha { sub foo { ... } } 1; perlfunc
  • 150. Package Blocks package Library::Awesome 1.234; sub foo { ... } 1; perlfunc
  • 151. Speaking of Packages perlmodlib
  • 152. Speaking of Packages - Perl 5.14 removed a bunch of modules perlmodlib
  • 153. Speaking of Packages - Perl 5.14 removed a bunch of modules - ...so there was room to add new ones! perlmodlib
  • 154. HTTP::Tiny use 5.14.0; use HTTP::Tiny; my $http = HTTP::Tiny->new; my $res = $http->get( $url ); print $res->{content} if $res->{success}; HTTP::Tiny
  • 155. JSON::PP use JSON::PP; my $data = decode_json( $json_string ); my $json = encode_json( $data_struct ); JSON::PP
  • 157. use 5.14.0; JSON::PP
  • 159. use 5.14.0; use autodie; use HTTP::Tiny; JSON::PP
  • 160. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; JSON::PP
  • 161. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; JSON::PP
  • 162. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; JSON::PP
  • 163. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; my $json = $http->get( $moose ); JSON::PP
  • 164. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; my $json = $http->get( $moose ); die $json->{reason} unless $json->{success}; JSON::PP
  • 165. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; my $json = $http->get( $moose ); die $json->{reason} unless $json->{success}; my $dist = decode_json( $json ); JSON::PP
  • 166. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; my $json = $http->get( $moose ); die $json->{reason} unless $json->{success}; my $dist = decode_json( $json ); my $tgz = $http->get( $json->{download_url} ); JSON::PP
  • 167. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; my $json = $http->get( $moose ); die $json->{reason} unless $json->{success}; my $dist = decode_json( $json ); my $tgz = $http->get( $json->{download_url} ); die $tgz->{reason} unless $tgz->{success}; JSON::PP
  • 168. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; my $json = $http->get( $moose ); die $json->{reason} unless $json->{success}; my $dist = decode_json( $json ); my $tgz = $http->get( $json->{download_url} ); die $tgz->{reason} unless $tgz->{success}; open my $fh, ‘>’, $dist->{archive}; JSON::PP
  • 169. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; my $json = $http->get( $moose ); die $json->{reason} unless $json->{success}; my $dist = decode_json( $json ); my $tgz = $http->get( $json->{download_url} ); die $tgz->{reason} unless $tgz->{success}; open my $fh, ‘>’, $dist->{archive}; $fh->print( $tgz->{content} ); JSON::PP
  • 170. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; my $json = $http->get( $moose ); die $json->{reason} unless $json->{success}; my $dist = decode_json( $json ); my $tgz = $http->get( $json->{download_url} ); die $tgz->{reason} unless $tgz->{success}; open my $fh, ‘>’, $dist->{archive}; $fh->print( $tgz->{content} ); $fh->close; JSON::PP
  • 171. use 5.14.0; use autodie; use HTTP::Tiny; use JSON::PP; my $moose = ‘http://api.metacpan.org/release/Moose’; my $http = HTTP::Tiny->new; my $json = $http->get( $moose ); die $json->{reason} unless $json->{success}; my $dist = decode_json( $json ); my $tgz = $http->get( $json->{download_url} ); die $tgz->{reason} unless $tgz->{success}; open my $fh, ‘>’, $dist->{archive}; $fh->print( $tgz->{content} ); $fh->close; IO::File
  • 172. IO::File open my $fh, ‘<’, $some_filename or die “can’t open fh: $!”; print {$fh} “Some output.”; close $fh or die “can’t close fh: $!”; perlopentut
  • 173. IO::File use 5.10.1; use autodie; open my $fh, ‘>’, $some_filename; print {$fh} “Some output.”; close $fh; autodie
  • 174. IO::File use 5.10.1; use autodie; use IO::File; open my $fh, ‘>’, $some_filename; $fh->print( “Some output.” ); $fh->close; IO::File
  • 175. IO::File use 5.14.0; use autodie; use IO::File; open my $fh, ‘>’, $some_filename; $fh->print( “Some output.” ); $fh->close; IO::File
  • 176. IO::File use 5.14.0; use autodie; open my $fh, ‘>’, $some_filename; $fh->print( “Some output.” ); $fh->close; IO::File
  • 177. IO::File use 5.14.0; use autodie; open my $fh, ‘>’, $some_filename; $fh->print( “Some output.” ); $fh->close or die “can’t close: $!”; IO::File
  • 178. $@ perlvar
  • 179. $@ Try::Tiny
  • 180. $@ - Well, actually, you use Try::Tiny, right? Try::Tiny
  • 181. $@ - Well, actually, you use Try::Tiny, right? - But this makes Try::Tiny more reliable, too! Try::Tiny
  • 182. $@ - Well, actually, you use Try::Tiny, right? - But this makes Try::Tiny more reliable, too! - You see, eval and $@ are totally awful Try::Tiny
  • 183. use 5.12.0; { package X; sub DESTROY { eval { } } } eval { my $x = bless {} => ‘X’; die “DEATH!!”; }; warn “ERROR: $@”; perlfunc
  • 184. use 5.12.0; { package X; sub DESTROY { eval { } } } eval { my $x = bless {} => ‘X’; die “DEATH!!”; }; warn “ERROR: $@”; $ perl5.12.4 test.pl ERROR: perlfunc
  • 185. use 5.14.0; { package X; sub DESTROY { eval { } } } eval { my $x = bless {} => ‘X’; die “DEATH!!”; }; warn “ERROR: $@”; perlfunc
  • 186. use 5.14.0; { package X; sub DESTROY { eval { } } } eval { my $x = bless {} => ‘X’; die “DEATH!!”; }; warn “ERROR: $@”; $ perl5.14.1 test.pl ERROR: DEATH!! perlfunc
  • 187. IPv6 Support! Socket
  • 188. IPv6 Support! - IPv4 is getting pretty old Socket
  • 189. IPv6 Support! - IPv4 is getting pretty old - not a big deal Socket
  • 190. IPv6 Support! - IPv4 is getting pretty old - not a big deal - won’t run out of addresses until 2011-04-15 Socket
  • 191. IPv6 Support! - IPv4 is getting pretty old - not a big deal - won’t run out of addresses until 2011-04-15 - …the future! Socket
  • 193. say “I o{23145} Perl 5.14!”; perlsyn
  • 194. say “I o{23145} Perl 5.14!”; I Perl 5.14! perlsyn
  • 195. say “I 23145 Perl 5.14!”; I ?45 Perl 5.14! perlsyn
  • 196. say “I 023145 Perl 5.14!”; I 145 Perl 5.14! perlsyn
  • 197. # Pretend there are 15 captures: qr{ (1) (2) (3) (4) 7 10 (5) (6) (7) (8) (9) 7 10 (10) 7 10 }x; perlre
  • 198. # Pretend there are 15 captures: qr{ (1) (2) (3) (4) o{7} o{10} (5) (6) (7) (8) (9) o{7} o{10} (10) g{7} g{10} }x; perlre
  • 199. my @hex = (0x0D, 0x0A); my @bin = (0b1101, 0b1010); perlsyn
  • 200. my @hex = (0x0D, 0x0A); my @bin = (0b1101, 0b1010); my @hex = (0X0D, 0X0A); my @bin = (0B1101, 0B1010); perlsyn
  • 201. printf “%hhun”, 10; printf “%tun”, 10; printf “%zun”, 10; perlfunc
  • 202. printf “%hhun”, 10; # char printf “%tun”, 10; # ptrdiff_t printf “%zun”, 10; # size_t perlfunc
  • 203. 0.0416303447718782 perlfunc
  • 204. perl -E ‘srand(1); say rand;’ perlfunc
  • 205. my $seed = srand; perlfunc