Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

What's new in Perl 5.10?

35,475 views

Published on

Perl 5.10 will be the next new stable version of Perl. Find out what features it will have.

Published in: Business, Technology
  • If we are speaking about saving time and money this site ⇒ www.HelpWriting.net ⇐ is going to be the best option!! I personally used lots of times and remain highly satisfied.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Follow the link, new dating source: ♥♥♥ http://bit.ly/2ZDZFYj ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ♥♥♥ http://bit.ly/2ZDZFYj ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download Full doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download PDF EBOOK here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download EPUB Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... Download doc Ebook here { http://shorturl.at/mzUV6 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Copas Url to Read eBook === http://ebookdfsrewsa.justdied.com/3868324143-kunst-x-kuba-zeitgenossische-positionen-seit-1989-katalog-zur-ausstellung-im-ludwig-forum-aachen-2017-2018.html
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

What's new in Perl 5.10?

  1. 1. What is new in Perl 5.10? <ul><li>Paul Fenwick </li></ul><ul><li>Audrey Tang </li></ul><ul><li>Leon Brocard </li></ul>
  2. 2. slidehist <ul><li>Monday: I'm presenting? </li></ul><ul><li>Tuesday: download Paul's slides </li></ul><ul><li>Wednesday: tweak design </li></ul><ul><li>Thursday: play with fonts </li></ul><ul><li>Friday: argh slides on a plane </li></ul><ul><li>Saturday: release! </li></ul>
  3. 3. perlhist <ul><li>1987: 1.0 </li></ul><ul><li>1988: 2.0 </li></ul><ul><li>1989: 3.0... </li></ul><ul><li>1991: 4.0... </li></ul><ul><li>1994: 5.0 </li></ul>
  4. 4. perlhist 5.0 <ul><li>1994: 5.0 </li></ul><ul><li>1995: 5.1 </li></ul><ul><li>1996: 5.2, 5.3 </li></ul><ul><li>1997: 5.4 </li></ul><ul><li>1998: 5.5... </li></ul><ul><li>2000: 5.6... </li></ul><ul><li>2002: 5.8 </li></ul>
  5. 5. 5.8 perlhist <ul><li>2002: 5.8.0 </li></ul><ul><li>2003: 5.8.1, 5.8.2 </li></ul><ul><li>2o04: 5.8.3, 5.8.4, 5.8.5, 5.8.6 </li></ul><ul><li>2005: 5.8.7 </li></ul><ul><li>2006: 5.8.8 </li></ul>
  6. 6. 2007 <ul><li>Stable: 5.8.9 </li></ul><ul><li>New: 5.10 </li></ul><ul><li>New new: 6.0.0 </li></ul>
  7. 7. New features <ul><li>Perl 5.10 has new features </li></ul><ul><li>Sorry Sebastian </li></ul>
  8. 8. New? <ul><li>new lexically-scoped feature pragma: </li></ul><ul><li>use feature qw(say switch); </li></ul><ul><li>use feature qw(:5.10); </li></ul><ul><li>use 5.10; </li></ul>
  9. 9. Optimise programmer time <ul><li>Most advanced programming language ever! </li></ul><ul><li>Perl: print “hello ” </li></ul><ul><li>Perl 6: say “hello” </li></ul><ul><li>Perl 5.10: say “hello” </li></ul>
  10. 10. Save typing <ul><li>My poor fingers! </li></ul><ul><li>Also none of this nasty quoting business </li></ul><ul><li>This might seem like it's trivial... </li></ul>
  11. 11. Or <ul><li>$c = $a | | $b is handy </li></ul><ul><li>confused by empty string, undef or zero </li></ul>
  12. 12. Defined or <ul><li>$c = $a // $b is handier </li></ul><ul><li>same as $c = defined($a) ? $a : $b </li></ul>
  13. 13. dor and err <ul><li>There's also low-precedence // </li></ul><ul><li>use feature qw(dor err); </li></ul><ul><li>fileno($x) dor die 'That's not a filehandle'; </li></ul><ul><li>fileno($x) err die 'That's not a filehandle'; </li></ul>
  14. 14. State variables <ul><li>The old way of having a persistent variable: </li></ul><ul><li>{ my $i = 0; sub incrementor { return $i++; } } </li></ul>
  15. 15. State variables <ul><li>use feature 'state'; sub incrementor { state $i = 0; return $i++; } </li></ul>
  16. 16. Local caches <ul><li>State variables can live deep inside subroutines... </li></ul><ul><li>for my $x (...) { for my $y (...) { state %seen; next if $seen{$x}{$y}++; } } </li></ul>
  17. 17. Switch <ul><li>Perl 5.10 introduces a native switch statement. </li></ul><ul><li>Similar to Perl 6's switch, and Switch.pm (source filter) </li></ul><ul><li>Built into the Perl interpreter </li></ul>
  18. 18. Guessing Game <ul><li>use feature qw(switch say); my @guessed; my $num = int(rand 100)+1; while (my $guess = <STDIN>) { chomp $guess; given($guess) { when (/D/) { say &quot;Give me an integer&quot; } when (@guessed) { say &quot;You've tried that&quot; } when ($num) { say &quot;Just right!&quot;; last } when ($_ < $num) { say &quot;Too low&quot;; continue } when ($_ > $num) { say &quot;Too high&quot;; continue } push(@guessed,$_); } } </li></ul>
  19. 19. foreach / when <ul><li>use feature 'switch'; foreach (@cool_things) { when (/pirate/) { $pirate++ } when (/ninja/) { $ninja++ } when (/robot/) { $robot++ } say &quot;$_ doesn't look cool...&quot;; } </li></ul><ul><li>when automatically calls next at the end of its block </li></ul>
  20. 20. Smart-match <ul><li>use feature '~~'; if ($x ~~ @array) { say &quot;$x exists&quot; } if ($x ~~ /ninja/) { say &quot;Ninja in string&quot;} if (@x ~~ /ninja/) { say &quot;Ninja in array&quot; } if ($key ~~ %hash) { say &quot;$key exists&quot; } if ($subref ~~ $arg) { say 'sub($arg) true' } </li></ul>
  21. 21. Smart-match <ul><li>use feature '~~'; if (@array ~~ $x) { say &quot;$x exists&quot; } if (/ninja/ ~~ $x) { say &quot;Ninja in string&quot;} if (/ninja/ ~~ @x) { say &quot;Ninja in array&quot; } if (%hash ~~ $key) { say &quot;$key exists&quot; } if ($arg ~~ $subref) { say 'sub($arg) true' } </li></ul><ul><li>~~ can be overloaded </li></ul>
  22. 22. UNIVERSAL::DOES <ul><li>Traditionally isa would be used to determine the capabilities of a class: </li></ul><ul><li>provides a way to show compatibility, without inheritance </li></ul><ul><li>$obj‐>isa('Logger'); </li></ul><ul><li>$obj‐>DOES('Logger'); </li></ul>
  23. 23. Helicopter <ul><li>package Helicopter; sub DOES { my ($this, $interface) = @_; return 1 if ($interface eq &quot;Airplane&quot;); return $this->SUPER::does($interface); } </li></ul>
  24. 24. Constant (un-)folding <ul><li>Perl 'folds' constants at compile time </li></ul><ul><li>9+5 gets converted to 14 </li></ul><ul><li>In Perl 5.10, exceptional constants are unfolded </li></ul><ul><li>They'll still throw run-time exceptions if you try to execute them </li></ul>
  25. 25. Hash::Util::FieldHash <ul><li>5.10 comes with support for Field Hashes, which: </li></ul><ul><ul><li>Can use references as hash keys </li></ul></ul><ul><ul><li>Reference-keys migrate correctly across threads </li></ul></ul><ul><ul><li>Entries to stale references are automatically deleted </li></ul></ul><ul><li>(Inside-Out objects work nicely) </li></ul>
  26. 26. Assertions <ul><li>Perl 5.10 implements real assertions </li></ul><ul><li>Normally compiled away </li></ul><ul><li>Can be enabled on a per-module basis </li></ul><ul><li># This is normally compiled away sub assert_sanity :assertion {...} # Enable assertions for MyModule perl -A=MyModule prog.pl </li></ul>
  27. 27. User-defined lexical pragmata <ul><li>We've used lexical pragmata for years: { use strict; ... } </li></ul><ul><li>In Perl 5.10 you can write your own! </li></ul><ul><li>%^H allows &quot;hints&quot; to be attached to the optree </li></ul><ul><li>use feature is implemented this way </li></ul>
  28. 28. More modules <ul><li>encoding::warnings </li></ul><ul><li>Math::BigInt::FastCalc </li></ul><ul><li>Time::Piece </li></ul><ul><li>Win32API::File </li></ul><ul><li>CPANPLUS </li></ul>
  29. 29. CPANPLUS <ul><li>Hi Jos! </li></ul><ul><li>It's about time, isn't it? </li></ul><ul><li>Means we have many other modules in the core... </li></ul>
  30. 30. Regex engine <ul><li>perlreguts </li></ul><ul><li>No longer recursive </li></ul><ul><li>Single char char-classes treated as literals </li></ul><ul><li>Trie optimisation of literal string alternations /foam|foal|foad/ => /foa[mld]/ </li></ul><ul><li>Aho-Corasick start-point optimisation </li></ul><ul><li>Regex engine </li></ul><ul><li>Pluggable: use re::engine::PCRE; </li></ul><ul><li>Named capture buffers </li></ul><ul><li>/$(?<price>d+)/ ... $+{price} </li></ul><ul><li>More </li></ul>
  31. 31. Other goodies <ul><li>Misc Attribute Decoration </li></ul><ul><li>$AUTOLOAD can be tainted </li></ul><ul><li>Source filters in @INC </li></ul><ul><li>encodings::warnings is lexical </li></ul><ul><li>Better threads </li></ul><ul><li>Faster UTF-8 </li></ul>
  32. 32. More other goodies <ul><li>Faster stat() on Windows </li></ul><ul><li>Relocatable installs </li></ul><ul><li>Overloading for re-blessed objects </li></ul><ul><li>Better Windows support </li></ul><ul><li>Smaller memory footprint (slightly faster) </li></ul><ul><li>More documentation </li></ul>
  33. 33. More details? <ul><li>http://search.cpan.org/dist/perl/pod/perl594delta.pod </li></ul>
  34. 34. Questions?
  35. 35. When will it be out? <ul><li>Stable: 5.8.9 “by April 1st” </li></ul><ul><li>New: 5.10 “after lunch, before Christmas” </li></ul><ul><li>New new: 6.0.0 “after lunch, before Christmas” </li></ul>
  36. 36. Any other questions?
  37. 37. License <ul><li>These slides are Copyright 2006 Paul Fenwick, Audrey Tang, Leon Brocard </li></ul><ul><li>The text may be distributed under your choice of any of the following: </li></ul><ul><ul><li>The license terms of Perl itself </li></ul></ul><ul><ul><li>GNU Free Documentation License </li></ul></ul><ul><ul><li>Creative Commons Attribution ShareAlike </li></ul></ul>

×