Perl 5.10
Upcoming SlideShare
Loading in...5
×
 

Perl 5.10

on

  • 3,428 views

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

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

Statistics

Views

Total Views
3,428
Views on SlideShare
3,426
Embed Views
2

Actions

Likes
2
Downloads
25
Comments
0

1 Embed 2

http://www.slideshare.net 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Perl 5.10 Perl 5.10 Presentation Transcript

  • 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 Now leader of London.pm Started YAPC::Europe perl hacker
  • Releases - - Perl - - Perl - - Perl - - Perl - - Perl ... Perl is years old Perl is years old
  • Perl releases - - Perl - - Perl . - - Perl . - - Perl . - - Perl . - - Perl . - - Perl . . - - Perl . . - - Perl . . - - Perl . .
  • Perl . New features
  • Perl . New feature use feature ’say’; use feature ’state’; use feature ’switch’; ... use feature ’:5.10’;
  • 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 (/^def/) { $def = 1; } when (/^xyz/) { $xyz = 1; } default { $nothing = 1; } }
  • 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’; } }
  • 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 Relative backreferences Vertical and horizontal whitespace, and linebreak
  • 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}"; }
  • 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.
  • 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
  • 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
  • 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 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 . . .
  • 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 added
  • More tests Perl . , core tests (+ , more for bundled libraries) Perl . . , core tests (+ , more for bundled libraries) Perl . . , core tests (+ , more for bundled libraries)
  • 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
  • Use Perl . now! Perl . is faster Perl . uses less memory Perl . has more features Perl . is backwards compatible