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                                        ...
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.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 ...
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                                               per...
5.14- 5.10 was a huge set of changes (too many!)- 5.12 was a lot smaller- 5.14 is in between                              ...
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?                 ...
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                           ...
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...
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...
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 “D...
...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                              ...
...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 rel...
...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 rel...
...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 rel...
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...
First: A Warning- 5.14 is backwards compatible- but has some new behaviors- they’re not all enabled by default; feature.pm...
First: A Warning- 5.14 is backwards compatible- but has some new behaviors- they’re not all enabled by default; feature.pm...
First: A Warning- 5.14 is backwards compatible- but has some new behaviors- they’re not all enabled by default; feature.pm...
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                     ...
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, be...
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, be...
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, be...
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, be...
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::CoreL...
:=     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                                          ...
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 Modifiersmy $hostname = get_hostname;$hostname =~ s/..*//;                               perlre
New Regex Modifiersmy $hostname = get_hostname =~ s/..*//;                                           perlre
New Regex Modifiers(my $hostname = get_hostname) =~ s/..*//;                                         perlre
New Regex Modifiersmy $hostname = get_hostname =~ s/..*//r;                                            perlre
New Regex Modifiersmy @short_names =  map { s/..*//; } @long_names;                                   perlre
New Regex Modifiersmy @short_names =  map { s/..*//;        $_ } @long_names;                            perlre
New Regex Modifiersmy @short_names =  map { my $x = $_;        $x =~ s/..*//;        $s } @long_names;                    ...
New Regex Modifiersmy @short_names =  map { s/..*//r } @long_names;                                   perlre
New Regex Modifiersmy @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                 ...
New Regex Modifiers/u - use Unicode rules  d matches BENGALI DIGIT FOUR  w matches LATIN SMALL LETTER ETH  “N{LATIN SMALL ...
New Regex Modifiers/a - Unicode, but ASCII rules for classes  d rejects BENGALI DIGIT FOUR  w rejects LATIN SMALL LETTER E...
New Regex Modifiers/aa - Unicode, ASCII won’t match non-ASCII  d rejects BENGALI DIGIT FOUR  w rejects LATIN SMALL LETTER ...
New Regex Modifiers/aa - Unicode, ASCII won’t match non-ASCII  d rejects BENGALI DIGIT FOUR  w rejects LATIN SMALL LETTER ...
New Regex Modifiers                      perlre
New Regex Modifiers/d - default semantics                         perlre
New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’s                                      perlre
New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’smaybe kinda unicode or the pattern            ...
New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’smaybe kinda unicode or the patternuses p or N{...
New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’smaybe kinda unicode or the patternuses p or N{...
New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’smaybe kinda unicode or the patternuses p or N{...
New Regex Modifiers/d - duhhhh-derrrrr semantics Use Unicode if it’s seems like it’s maybe kinda unicode or the pattern us...
New Regex Modifiers# To be really ASCII-only:die “funny un-American characters”  if $str =~ /[^x00-x7F]/;$str =~ /...actua...
What should I do??- Learn as much as you can!- Seriously!- Decode user input, use /aa, use p_- Consider: use re ‘/aa’- But...
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- bett...
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                            ...
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                                     p...
That Stuff in 5.14- local works even more betterer- assigning to ($[) gets a warning- each works on arrayrefs             ...
each on arrayrefsmy @array =   qw( foo bar baz )   ;while (my ($k, $v) = each @array) {  say “$k: $v”;}                   ...
each on arrayrefsmy @array =   qw( foo bar baz )   ;while (my ($k, $v) = each @array) {  say “$k: $v”;}0: foo1: bar2: baz ...
each on arrayrefsmy $array = [ qw( foo bar baz ) ];while (my ($k, $v) = each $array) {  say “$k: $v”;}0: foo1: bar2: baz  ...
each on arrayrefs                    perlfunc
each on arrayrefsmy ($x, $y) = each @{ $h->{foo}[1] }                                       perlfunc
each on arrayrefsmy ($x, $y) = each @{ $h->{foo}[1] }my ($x, $y) = each   $h->{foo}[1]                                    ...
AVOIDeach @array
built-ins on references                          perlfunc
built-ins on referencespush $arrayref                             perlfunc
built-ins on referencespush $arrayrefpop $arrayref                             perlfunc
built-ins on referencespush $arrayrefpop $arrayrefshift   $arrayref                             perlfunc
built-ins on referencespush $arrayrefpop $arrayrefshift   $arrayrefunshift $arrayref                             perlfunc
built-ins on referencespush $arrayrefpop $arrayrefshift   $arrayrefunshift $arrayrefsplice $arrayref                      ...
built-ins on referencespush $arrayrefpop $arrayrefshift   $arrayrefunshift $arrayrefsplice $arrayrefkeys   $arrayref      ...
built-ins on referencespush $arrayrefpop $arrayrefshift   $arrayrefunshift $arrayrefsplice $arrayrefkeys   $arrayrefvalues...
built-ins on referencespush $arrayrefpop $arrayrefshift   $arrayrefunshift $arrayrefsplice $arrayrefkeys   $arrayrefvalues...
built-ins on referencespush $arrayrefpop $arrayrefshift   $arrayrefunshift $arrayrefsplice $arrayrefkeys   $arrayrefvalues...
built-ins on referencespush $arrayrefpop $arrayrefshift   $arrayrefunshift $arrayrefsplice $arrayrefkeys   $arrayrefvalues...
built-ins on referencespush $arrayrefpop $arrayrefshift   $arrayrefunshift $arrayrefsplice $arrayrefkeys   $arrayrefvalues...
built-ins on referencespush $arrayrefpop $arrayrefshift             AL        $arrayref            T          Nunshift $ar...
built-ins on references                          perlfunc
built-ins on referencessub demo (+$) {                             perlfunc
built-ins on referencessub demo (+$) {  my ($x, $y) = @_;                             perlfunc
built-ins on referencessub demo (+$) {  my ($x, $y) = @_;  # do stuff                             perlfunc
built-ins on referencessub demo (+$) {  my ($x, $y) = @_;  # do stuff}                             perlfunc
built-ins on referencessub demo (+$) {  my ($x, $y) = @_;  # do stuff}demo( @array, $n );                             perl...
built-ins on referencessub demo (+$) {  my ($x, $y) = @_;  # do stuff}demo( @array, $n );demo(@array, $n );               ...
built-ins on referencessub demo (+$) {  my ($x, $y) = @_;  # do stuff}demo( @array, $n );demo(@array, $n );demo( %hash, $n...
built-ins on referencessub demo (+$) {  my ($x, $y) = @_;  # do stuff}demo( @array,   $n   );demo(@array,   $n   );demo( %...
Package Blockspackage Library::Awesome;our $VERSION = 1.234;sub foo { ... }1;                            perlfunc
Package Blockspackage Library::Awesome 1.234 {    sub foo { ... }}1;                                   perlfunc
Package Blockspackage Library::Awesome 1.234 {    sub foo { ... }}1;                                   perlfunc
Package Blockspackage Library::Awesome 0.2-1alpha {    sub foo { ... }}1;                                        perlfunc
Package Blockspackage 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!                         ...
HTTP::Tinyuse 5.14.0;use HTTP::Tiny;my $http = HTTP::Tiny->new;my $res = $http->get( $url );print $res->{content} if $res-...
JSON::PPuse JSON::PP;my $data = decode_json( $json_string );my $json = encode_json( $data_struct );                       ...
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’;           ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
use   5.14.0;use   autodie;use   HTTP::Tiny;use   JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’;my $http = ...
IO::Fileopen my $fh, ‘<’, $some_filename  or die “can’t open fh: $!”;print {$fh} “Some output.”;close $fh or die “can’t cl...
IO::Fileuse 5.10.1;use autodie;open my $fh, ‘>’, $some_filename;print {$fh} “Some output.”;close $fh;                     ...
IO::Fileuse 5.10.1;use autodie;use IO::File;open my $fh, ‘>’, $some_filename;$fh->print( “Some output.” );$fh->close;     ...
IO::Fileuse 5.14.0;use autodie;use IO::File;open my $fh, ‘>’, $some_filename;$fh->print( “Some output.” );$fh->close;     ...
IO::Fileuse 5.14.0;use autodie;open my $fh, ‘>’, $some_filename;$fh->print( “Some output.” );$fh->close;                  ...
IO::Fileuse 5.14.0;use autodie;open my $fh, ‘>’, $some_filename;$fh->print( “Some output.” );$fh->close or die “can’t clos...
$@     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!                               ...
$@- Well, actually, you use Try::Tiny, right?- But this makes Try::Tiny more reliable, too!- You see, eval and $@ are tota...
use 5.12.0;{    package X;    sub DESTROY { eval { } }}eval {  my $x = bless {} => ‘X’;  die “DEATH!!”;};warn “ERROR: $@”;...
use 5.12.0;{    package X;    sub DESTROY { eval { } }}eval {  my $x = bless {} => ‘X’;  die “DEATH!!”;};warn “ERROR: $@”;...
use 5.14.0;{    package X;    sub DESTROY { eval { } }}eval {  my $x = bless {} => ‘X’;  die “DEATH!!”;};warn “ERROR: $@”;...
use 5.14.0;{    package X;    sub DESTROY { eval { } }}eval {  my $x = bless {} => ‘X’;  die “DEATH!!”;};warn “ERROR: $@”;...
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                    ...
IPv6 Support!- IPv4 is getting pretty old- not a big deal- won’t run out of addresses until 2011-04-15- …the future!      ...
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;      ...
# 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...
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);                  ...
printf “%hhun”, 10;printf “%tun”, 10;printf “%zun”, 10;                       perlfunc
printf “%hhun”, 10; # charprintf “%tun”, 10;   # ptrdiff_tprintf “%zun”, 10;   # size_t                                   ...
0.0416303447718782                     perlfunc
perl -E ‘srand(1); say rand;’                                perlfunc
my $seed = srand;                    perlfunc
http://www.perl.org/get.html
Any questions?
Upcoming SlideShare
Loading in …5
×

Perl 5.14 for Pragmatists

5,105 views
4,921 views

Published on

Published in: Technology
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,105
On SlideShare
0
From Embeds
0
Number of Embeds
1,821
Actions
Shares
0
Downloads
103
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Perl 5.14 for Pragmatists

  1. 1. Perl 5.14 for pragmatists
  2. 2. 5.14 perlhist
  3. 3. 5.14- after 5.8, we had to wait 5 years for 5.10 perlhist
  4. 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. 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. 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. 7. 5.14 perlhist
  8. 8. 5.14- 5.10 was a huge set of changes (too many!) perlhist
  9. 9. 5.14- 5.10 was a huge set of changes (too many!)- 5.12 was a lot smaller perlhist
  10. 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. 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. 12. 5.14 is a Mixed Bag perl5140delta
  13. 13. 5.14 is a Mixed Bag- this talk isn’t just for beginners perl5140delta
  14. 14. 5.14 is a Mixed Bag- this talk isn’t just for beginners- some of these changes are at the edges perl5140delta
  15. 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. 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. 17. By the way, 5.16... perl5150delta
  18. 18. By the way, 5.16...- ...and beyond are going to be interesting perl5150delta
  19. 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. 20. ...and 5.10 is EOL perlpolicy
  21. 21. ...and 5.10 is EOL- we accept critical bugfixes for 2 maint tracks perlpolicy
  22. 22. ...and 5.10 is EOL- we accept critical bugfixes for 2 maint tracks- that’s now 5.14 and 5.12 perlpolicy
  23. 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. 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. 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. 26. but enough about other versions
  27. 27. let’s talk about 5.14
  28. 28. First: A Warning feature
  29. 29. First: A Warning- 5.14 is backwards compatible feature
  30. 30. First: A Warning- 5.14 is backwards compatible- but has some new behaviors feature
  31. 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. 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. 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. 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
  35. 35. Stuff That’s Gone perlsyn
  36. 36. Stuff That’s Gone- modules deprecated in 5.12 are gone in 5.14 perlsyn
  37. 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. 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. 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. 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. 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. 42. Stuff That’s Going Perl4::CoreLibs
  43. 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. 44. := attributes
  45. 45. :=sub login : Local { ... } attributes
  46. 46. :=sub login : Local { ... }my $x : Private = 10; attributes
  47. 47. :=sub login : Local { ... }my $x : Private = 10;my $x := 10; attributes
  48. 48. :=sub login : Local { ... }my $x : Private = 10;my $x := 10; attributes
  49. 49. qw()for my $show qw(Smallville Lost V) { $tivo->cancel_pass( $show );} perlop
  50. 50. qw()for my $show (qw(Smallville Lost V)) { $tivo->cancel_pass( $show );} perlop
  51. 51. That’s it! perl5140delta
  52. 52. That’s it!- those are all the things being removed perl5140delta
  53. 53. That’s it!- those are all the things being removed- these are not scary removals perl5140delta
  54. 54. One More Thing! perlsyn
  55. 55. One More Thing!$str =~ m/foo/sand bar; perlsyn
  56. 56. One More Thing!$str =~ m/foo/sand bar;$str =~ m/foo/s and bar; perlsyn
  57. 57. New Regex Modifiersmy $hostname = get_hostname;$hostname =~ s/..*//; perlre
  58. 58. New Regex Modifiersmy $hostname = get_hostname =~ s/..*//; perlre
  59. 59. New Regex Modifiers(my $hostname = get_hostname) =~ s/..*//; perlre
  60. 60. New Regex Modifiersmy $hostname = get_hostname =~ s/..*//r; perlre
  61. 61. New Regex Modifiersmy @short_names = map { s/..*//; } @long_names; perlre
  62. 62. New Regex Modifiersmy @short_names = map { s/..*//; $_ } @long_names; perlre
  63. 63. New Regex Modifiersmy @short_names = map { my $x = $_; $x =~ s/..*//; $s } @long_names; perlre
  64. 64. New Regex Modifiersmy @short_names = map { s/..*//r } @long_names; perlre
  65. 65. New Regex Modifiersmy @short_names = map s/..*//r, @long_names; perlre
  66. 66. New Regex Modifiers/u/a/aa/l/d perlre
  67. 67. New Regex Modifiers perllocale
  68. 68. New Regex Modifiers/l - use locale rules perllocale
  69. 69. New Regex Modifiers/l - use locale rules YOU DON’T WANT THIS perllocale
  70. 70. New Regex Modifiers perlre
  71. 71. New Regex Modifiers/u - use Unicode rules perlre
  72. 72. New Regex Modifiers/u - use Unicode rules d matches BENGALI DIGIT FOUR perlre
  73. 73. New Regex Modifiers/u - use Unicode rules d matches BENGALI DIGIT FOUR w matches LATIN SMALL LETTER ETH perlre
  74. 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. 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. 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. 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
  78. 78. New Regex Modifiers perlre
  79. 79. New Regex Modifiers/d - default semantics perlre
  80. 80. New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’s perlre
  81. 81. New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’smaybe kinda unicode or the pattern perlre
  82. 82. New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’smaybe kinda unicode or the patternuses p or N{...} perlre
  83. 83. New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’smaybe kinda unicode or the patternuses p or N{...}Otherwise, on ASCII systems use ASCII perlre
  84. 84. New Regex Modifiers/d - default semanticsUse Unicode if it’s seems like it’smaybe kinda unicode or the patternuses p or N{...}Otherwise, on ASCII systems use ASCIIOtherwise, on EBCDIC systems use Latin-1 perlre
  85. 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. 86. New Regex Modifiers# To be really ASCII-only:die “funny un-American characters” if $str =~ /[^x00-x7F]/;$str =~ /...actual pattern.../; perlre
  87. 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
  88. 88. New Regex Modifiers perlre
  89. 89. New Regex Modifiers$ perl-5.12.4 -E ‘say qr//’ perlre
  90. 90. New Regex Modifiers$ perl-5.12.4 -E ‘say qr//’(?-xism:) perlre
  91. 91. New Regex Modifiers$ perl-5.12.4 -E ‘say qr//’(?-xism:)$ perl-5.14.1 -E ‘say qr//’ perlre
  92. 92. New Regex Modifiers$ perl-5.12.4 -E ‘say qr//’(?-xism:)$ perl-5.14.1 -E ‘say qr//’(?^u:) perlre
  93. 93. Perl is really good at Unicode. perlunitut
  94. 94. Perl is really good at Unicode.Unicode is just that complex. perlunitut
  95. 95. More Unicode!- ...well, as long as we’re on the subject... perlunitut
  96. 96. Unicode 6 charnames
  97. 97. Unicode 6 charnames
  98. 98. Unicode 6 charnames
  99. 99. Unicode 6 charnames
  100. 100. Unicode 6 charnames
  101. 101. Unicode 6 charnames
  102. 102. Unicode 6 charnames
  103. 103. Unicode 6 charnames
  104. 104. Unicode 6 charnames
  105. 105. Unicode 6 charnames
  106. 106. Unicode 6 charnames
  107. 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
  108. 108. Container Improvements
  109. 109. Stuff From 5.12 perl5120delta
  110. 110. Stuff From 5.12- local works more better perl5120delta
  111. 111. Stuff From 5.12- local works more better- assigning to $[ gets a warning perl5120delta
  112. 112. Stuff From 5.12- local works more better- assigning to $[ gets a warning- each works on arrays perl5120delta
  113. 113. That Stuff in 5.14 perl5140delta
  114. 114. That Stuff in 5.14- local works even more betterer perl5140delta
  115. 115. That Stuff in 5.14- local works even more betterer- assigning to ($[) gets a warning perl5140delta
  116. 116. That Stuff in 5.14- local works even more betterer- assigning to ($[) gets a warning- each works on arrayrefs perl5140delta
  117. 117. each on arrayrefsmy @array = qw( foo bar baz ) ;while (my ($k, $v) = each @array) { say “$k: $v”;} perlfunc
  118. 118. each on arrayrefsmy @array = qw( foo bar baz ) ;while (my ($k, $v) = each @array) { say “$k: $v”;}0: foo1: bar2: baz perlfunc
  119. 119. each on arrayrefsmy $array = [ qw( foo bar baz ) ];while (my ($k, $v) = each $array) { say “$k: $v”;}0: foo1: bar2: baz perlfunc
  120. 120. each on arrayrefs perlfunc
  121. 121. each on arrayrefsmy ($x, $y) = each @{ $h->{foo}[1] } perlfunc
  122. 122. each on arrayrefsmy ($x, $y) = each @{ $h->{foo}[1] }my ($x, $y) = each $h->{foo}[1] perlfunc
  123. 123. AVOIDeach @array
  124. 124. built-ins on references perlfunc
  125. 125. built-ins on referencespush $arrayref perlfunc
  126. 126. built-ins on referencespush $arrayrefpop $arrayref perlfunc
  127. 127. built-ins on referencespush $arrayrefpop $arrayrefshift $arrayref perlfunc
  128. 128. built-ins on referencespush $arrayrefpop $arrayrefshift $arrayrefunshift $arrayref perlfunc
  129. 129. built-ins on referencespush $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayref perlfunc
  130. 130. built-ins on referencespush $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayrefkeys $arrayref perlfunc
  131. 131. built-ins on referencespush $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayrefkeys $arrayrefvalues $arrayref perlfunc
  132. 132. built-ins on referencespush $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayrefkeys $arrayrefvalues $arrayrefeach $arrayref perlfunc
  133. 133. built-ins on referencespush $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayrefkeys $arrayrefvalues $arrayrefeach $arrayrefkeys $hashref perlfunc
  134. 134. built-ins on referencespush $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayrefkeys $arrayrefvalues $arrayrefeach $arrayrefkeys $hashrefvalues $hashref perlfunc
  135. 135. built-ins on referencespush $arrayrefpop $arrayrefshift $arrayrefunshift $arrayrefsplice $arrayrefkeys $arrayrefvalues $arrayrefeach $arrayrefkeys $hashrefvalues $hashrefeach $hashref perlfunc
  136. 136. built-ins on referencespush $arrayrefpop $arrayrefshift AL $arrayref T Nunshift $arrayrefkeys I Esplice $arrayref M $arrayref Peach ERvalues $arrayref $arrayrefEXkeyseach $hashrefvalues $hashref $hashref perlfunc
  137. 137. built-ins on references perlfunc
  138. 138. built-ins on referencessub demo (+$) { perlfunc
  139. 139. built-ins on referencessub demo (+$) { my ($x, $y) = @_; perlfunc
  140. 140. built-ins on referencessub demo (+$) { my ($x, $y) = @_; # do stuff perlfunc
  141. 141. built-ins on referencessub demo (+$) { my ($x, $y) = @_; # do stuff} perlfunc
  142. 142. built-ins on referencessub demo (+$) { my ($x, $y) = @_; # do stuff}demo( @array, $n ); perlfunc
  143. 143. built-ins on referencessub demo (+$) { my ($x, $y) = @_; # do stuff}demo( @array, $n );demo(@array, $n ); perlfunc
  144. 144. built-ins on referencessub demo (+$) { my ($x, $y) = @_; # do stuff}demo( @array, $n );demo(@array, $n );demo( %hash, $n ); perlfunc
  145. 145. built-ins on referencessub demo (+$) { my ($x, $y) = @_; # do stuff}demo( @array, $n );demo(@array, $n );demo( %hash, $n );demo(%hash, $n ); perlfunc
  146. 146. Package Blockspackage Library::Awesome;our $VERSION = 1.234;sub foo { ... }1; perlfunc
  147. 147. Package Blockspackage Library::Awesome 1.234 { sub foo { ... }}1; perlfunc
  148. 148. Package Blockspackage Library::Awesome 1.234 { sub foo { ... }}1; perlfunc
  149. 149. Package Blockspackage Library::Awesome 0.2-1alpha { sub foo { ... }}1; perlfunc
  150. 150. Package Blockspackage Library::Awesome 1.234;sub foo { ... }1; perlfunc
  151. 151. Speaking of Packages perlmodlib
  152. 152. Speaking of Packages- Perl 5.14 removed a bunch of modules perlmodlib
  153. 153. Speaking of Packages- Perl 5.14 removed a bunch of modules- ...so there was room to add new ones! perlmodlib
  154. 154. HTTP::Tinyuse 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. 155. JSON::PPuse JSON::PP;my $data = decode_json( $json_string );my $json = encode_json( $data_struct ); JSON::PP
  156. 156. JSON::PP
  157. 157. use 5.14.0; JSON::PP
  158. 158. use 5.14.0;use autodie; JSON::PP
  159. 159. use 5.14.0;use autodie;use HTTP::Tiny; JSON::PP
  160. 160. use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP; JSON::PP
  161. 161. use 5.14.0;use autodie;use HTTP::Tiny;use JSON::PP;my $moose = ‘http://api.metacpan.org/release/Moose’; JSON::PP
  162. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 172. IO::Fileopen my $fh, ‘<’, $some_filename or die “can’t open fh: $!”;print {$fh} “Some output.”;close $fh or die “can’t close fh: $!”; perlopentut
  173. 173. IO::Fileuse 5.10.1;use autodie;open my $fh, ‘>’, $some_filename;print {$fh} “Some output.”;close $fh; autodie
  174. 174. IO::Fileuse 5.10.1;use autodie;use IO::File;open my $fh, ‘>’, $some_filename;$fh->print( “Some output.” );$fh->close; IO::File
  175. 175. IO::Fileuse 5.14.0;use autodie;use IO::File;open my $fh, ‘>’, $some_filename;$fh->print( “Some output.” );$fh->close; IO::File
  176. 176. IO::Fileuse 5.14.0;use autodie;open my $fh, ‘>’, $some_filename;$fh->print( “Some output.” );$fh->close; IO::File
  177. 177. IO::Fileuse 5.14.0;use autodie;open my $fh, ‘>’, $some_filename;$fh->print( “Some output.” );$fh->close or die “can’t close: $!”; IO::File
  178. 178. $@ perlvar
  179. 179. $@ Try::Tiny
  180. 180. $@- Well, actually, you use Try::Tiny, right? Try::Tiny
  181. 181. $@- Well, actually, you use Try::Tiny, right?- But this makes Try::Tiny more reliable, too! Try::Tiny
  182. 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. 183. use 5.12.0;{ package X; sub DESTROY { eval { } }}eval { my $x = bless {} => ‘X’; die “DEATH!!”;};warn “ERROR: $@”; perlfunc
  184. 184. use 5.12.0;{ package X; sub DESTROY { eval { } }}eval { my $x = bless {} => ‘X’; die “DEATH!!”;};warn “ERROR: $@”;$ perl5.12.4 test.plERROR: perlfunc
  185. 185. use 5.14.0;{ package X; sub DESTROY { eval { } }}eval { my $x = bless {} => ‘X’; die “DEATH!!”;};warn “ERROR: $@”; perlfunc
  186. 186. use 5.14.0;{ package X; sub DESTROY { eval { } }}eval { my $x = bless {} => ‘X’; die “DEATH!!”;};warn “ERROR: $@”;$ perl5.14.1 test.plERROR: DEATH!! perlfunc
  187. 187. IPv6 Support! Socket
  188. 188. IPv6 Support!- IPv4 is getting pretty old Socket
  189. 189. IPv6 Support!- IPv4 is getting pretty old- not a big deal Socket
  190. 190. IPv6 Support!- IPv4 is getting pretty old- not a big deal- won’t run out of addresses until 2011-04-15 Socket
  191. 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
  192. 192. More Random Stuff
  193. 193. say “I o{23145} Perl 5.14!”; perlsyn
  194. 194. say “I o{23145} Perl 5.14!”;I Perl 5.14! perlsyn
  195. 195. say “I 23145 Perl 5.14!”;I ?45 Perl 5.14! perlsyn
  196. 196. say “I 023145 Perl 5.14!”;I 145 Perl 5.14! perlsyn
  197. 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. 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. 199. my @hex = (0x0D, 0x0A);my @bin = (0b1101, 0b1010); perlsyn
  200. 200. my @hex = (0x0D, 0x0A);my @bin = (0b1101, 0b1010);my @hex = (0X0D, 0X0A);my @bin = (0B1101, 0B1010); perlsyn
  201. 201. printf “%hhun”, 10;printf “%tun”, 10;printf “%zun”, 10; perlfunc
  202. 202. printf “%hhun”, 10; # charprintf “%tun”, 10; # ptrdiff_tprintf “%zun”, 10; # size_t perlfunc
  203. 203. 0.0416303447718782 perlfunc
  204. 204. perl -E ‘srand(1); say rand;’ perlfunc
  205. 205. my $seed = srand; perlfunc
  206. 206. http://www.perl.org/get.html
  207. 207. Any questions?

×