Perl .

      Léon Brocard


London Perl Workshop
Me


 Léon Brocard
 French, live in London
 Like food
 Like the colour orange
 Founded Amsterdam.pm, Bath.pm, Croydon.pm
 ...
Releases


      -   -   Perl
      -   -   Perl
      -   -   Perl
      -   -   Perl
      -   -   Perl
  ...
  Perl is ...
Perl releases

     -   -   Perl
     -   -   Perl   .
     -   -   Perl   .
     -   -   Perl   .
     -   -   Perl   .
 ...
Perl .   New features
Perl .     New feature



  use   feature ’say’;
  use   feature ’state’;
  use   feature ’switch’;
  ...
  use   feature ...
Say operator



  Just like print, but implicitly appends a newline
  use feature ’say’;
  say ’Hello!’;
State operator



  Persistent private variables
  use feature ’state’;
  sub gimme_another { state $x; return ++$x }
Smart match operator



  $a ~~   /foo/
  @a ~~   /foo/
  $a ~~   @b
  $a ~~   %b
  ...
Switch and smart match operator


  use feature ’switch’;
  given ($foo) {
    when (/^abc/) { $abc   = 1; }
    when (/^d...
Switch and smart match operator
  use feature ":5.10";
  given($foo) {
    when (undef) { say ’$foo is undefined’; }
    w...
De ned-or operator



  $a // $b
  defined $a ? $a : $b

  $c //= $d;
  $c = $d unless defined $c;
Regular expressions


  Recursive patterns
  Named capture bu ers
  Possessive quanti ers
  Backtracking control verbs
  R...
Named capture bu ers

  use feature ’say’;
  my $time = ’Time: 01:02:03’;

  if ($time =~ /Time:s(d+):(d+):(d+)/) {
    sa...
New modules

 Archive::Extract, Archive::Tar,
 Compress::Zlib, CPANPLUS, Digest::SHA,
 encoding::warnings, ExtUtils::CBuil...
New documentation


 perlpragma — How to write a user pragma
 perlglossary — Perl Glossary
 perlreguts — Regular expressio...
Performance enhancements

  In-place sorting
  Lexical array access
  XS-assisted SWASHGET
  Constant subroutines
  PERL_D...
Deprecations



  Pseudo-hashes have been removed
  Removal of the bytecode compiler and of perlcc
  Removal of the JPL
Other

  Lexical $_, _ prototype, UNITCHECK blocks, mro pragma,
  readpipe() is now overridable, default argument for
  re...
Perl . .




  Many bug xes: @_
  Optimised internals: isa()
New features, modules



  DTrace support
  autodie
  Compress::Raw::Bzip
  parent
  Parse::CPAN::Meta
Platform updates

  AIX
  Cygwin
  FreeBSD
  Irix
  Haiku
  MirOS BSD
  NetBSD
  Stratus VOS
  Symbian
  Win
  VMS
Feature tweaks



  given/when
  switch
  smart match
Deprecations




  Switch
  suidperl
Internal changes




  Moved from Perforce to Git
  Changed directory structure
Better quotes




     e J.R.R. Tolkien quotes at the head of each C source
   le have been checked and proper citations a...
More tests


  Perl    .     ,     core tests
  (+     ,      more for bundled libraries)
  Perl    . .       ,    core te...
Recent past and future


  Perl   .   .   : Léon Brocard on Nov ,
  Perl   .   .   : Jesse Vincent on Dec ,
  Perl   .   ....
Use Perl .         now!



  Perl   .   is faster
  Perl   .   uses less memory
  Perl   .   has more features
  Perl   . ...
Upcoming SlideShare
Loading in...5
×

Perl 5.10

2,554

Published on

My talk on Perl 5.10 at the London Perl Workshop 2009.

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,554
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
26
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Perl 5.10

  1. 1. Perl . Léon Brocard London Perl Workshop
  2. 2. Me Léon Brocard French, live in London Like food Like the colour orange Founded Amsterdam.pm, Bath.pm, Croydon.pm Now leader of London.pm Started YAPC::Europe perl hacker
  3. 3. Releases - - Perl - - Perl - - Perl - - Perl - - Perl ... Perl is years old Perl is years old
  4. 4. Perl releases - - Perl - - Perl . - - Perl . - - Perl . - - Perl . - - Perl . - - Perl . . - - Perl . . - - Perl . . - - Perl . .
  5. 5. Perl . New features
  6. 6. Perl . New feature use feature ’say’; use feature ’state’; use feature ’switch’; ... use feature ’:5.10’;
  7. 7. Say operator Just like print, but implicitly appends a newline use feature ’say’; say ’Hello!’;
  8. 8. State operator Persistent private variables use feature ’state’; sub gimme_another { state $x; return ++$x }
  9. 9. Smart match operator $a ~~ /foo/ @a ~~ /foo/ $a ~~ @b $a ~~ %b ...
  10. 10. Switch and smart match operator use feature ’switch’; given ($foo) { when (/^abc/) { $abc = 1; } when (/^def/) { $def = 1; } when (/^xyz/) { $xyz = 1; } default { $nothing = 1; } }
  11. 11. Switch and smart match operator use feature ":5.10"; given($foo) { when (undef) { say ’$foo is undefined’; } when ("foo") { say ’$foo is the string "foo"’; } when ([1,3,5,7,9]) { say ’$foo is an odd digit’; continue; # Fall through } when ($_ < 100) { say ’< 100’; } when (&complicated_check) { say ’a complicated check for $foo is true’; } default { die ’Eeeeek’; } }
  12. 12. De ned-or operator $a // $b defined $a ? $a : $b $c //= $d; $c = $d unless defined $c;
  13. 13. Regular expressions Recursive patterns Named capture bu ers Possessive quanti ers Backtracking control verbs Relative backreferences Vertical and horizontal whitespace, and linebreak
  14. 14. Named capture bu ers use feature ’say’; my $time = ’Time: 01:02:03’; if ($time =~ /Time:s(d+):(d+):(d+)/) { say "$1 / $2 / $3"; } if ($time =~ /Time:s(?<hours>d+): (?<minutes>d+):(?<seconds>d+)/x) { say "$+{hours} / $+{minutes} / $+{seconds}"; }
  15. 15. New modules Archive::Extract, Archive::Tar, Compress::Zlib, CPANPLUS, Digest::SHA, encoding::warnings, ExtUtils::CBuilder, ExtUtils::ParseXS, File::Fetch, Hash::Util::FieldHash, IO::Zlib, IPC::Cmd, Locale::Maketext::Simple, Log::Message, Log::Message::Simple, Math::BigInt::FastCalc, Module::Build, Module::CoreList, Module::Load, Module::Load::Conditional, Module::Loaded, Module::Pluggable, Object::Accessor, Package::Constants, Params::Check, Pod::Escapes, Pod::Simple, Term::UI, Time::Piece, Win32API::File.
  16. 16. New documentation perlpragma — How to write a user pragma perlglossary — Perl Glossary perlreguts — Regular expression engine internals perlreapi — Regular expression plugin interface perlunitut — Perl Unicode Tutorial perlunifaq — Perl Unicode FAQ perlcommunity — Overview of the Perl community CORE — Pseudo-namespace for Perl’s core routines
  17. 17. Performance enhancements In-place sorting Lexical array access XS-assisted SWASHGET Constant subroutines PERL_DONT_CREATE_GVSV Weak references are cheaper sort() enhancements Memory optimisations UTF- cache optimisation Sloppy stat on Windows Regular expressions optimisations
  18. 18. Deprecations Pseudo-hashes have been removed Removal of the bytecode compiler and of perlcc Removal of the JPL
  19. 19. Other Lexical $_, _ prototype, UNITCHECK blocks, mro pragma, readpipe() is now overridable, default argument for readline(), UNIVERSAL::DOES(), formats, byte-order modi ers for pack() and unpack(), no VERSION, chdir, chmod, chown on lehandles, OS groups, recursive sort subs, exceptions in constant folding, source lters in @INC, new internal variables, UCD . . , Miscellaneous Attribute Decoration, con guration improvements, compilation improvements, relocatable installations, nicer internals bison-based parser . . .
  20. 20. Perl . . Many bug xes: @_ Optimised internals: isa()
  21. 21. New features, modules DTrace support autodie Compress::Raw::Bzip parent Parse::CPAN::Meta
  22. 22. Platform updates AIX Cygwin FreeBSD Irix Haiku MirOS BSD NetBSD Stratus VOS Symbian Win VMS
  23. 23. Feature tweaks given/when switch smart match
  24. 24. Deprecations Switch suidperl
  25. 25. Internal changes Moved from Perforce to Git Changed directory structure
  26. 26. Better quotes e J.R.R. Tolkien quotes at the head of each C source le have been checked and proper citations added
  27. 27. More tests Perl . , core tests (+ , more for bundled libraries) Perl . . , core tests (+ , more for bundled libraries) Perl . . , core tests (+ , more for bundled libraries)
  28. 28. Recent past and future Perl . . : Léon Brocard on Nov , Perl . . : Jesse Vincent on Dec , Perl . . : Ricardo Signes on Jan , Perl . . : Steve Hay on Feb , Perl . . : Ask Bjørn Hansen on Mar , ... Perl . : Jesse Vincent early
  29. 29. Use Perl . now! Perl . is faster Perl . uses less memory Perl . has more features Perl . is backwards compatible
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×