This is a bit of a departure from normal, to continue the Community's celebration for Perl's 20th Birthday.
Our favorite language turned 20 yesterday. (I hope Perl doesn't go out and get really loaded next year.) So what did the community give to Perl this anniversary?
Perl 5.10? What's that? Is it just 5.8.9, rounding up? No, so much more than a maintenance release. Is that like Perl 6, in time for this Christmas? No, not really, but closer than some might imagine. And whatever it is, it is in time for this Christmas.
First, and best for folks with legacy code (and with CPAN, that's all of us), 5.10 is backwards compatible by default, so can be treated like a maintenance release of 5.8.x if you want to (or need to). All new features are, by default, b
So What new features are available?
So what will be our first Perl 5.10 program be, Hello World or a JAPH or something showing syntax? TIMTOWTDI, so why choose!
perl mod19.pl hello world 0 ' ' undef JaPh jApH
Hello World
Hello World for the 2th time
Hello 0 for the 3th time
Hello 0 for the 4th time
Hello World for the 5th time
Hello Just another Perl 5.10 hacker for the 6th time
Hello just Another perl 5.10 Hacker for the 7th time
1 use feature ':5.10'; # or ... 2 # use 5.10.0; or 5.9.5 or v5.10 or 5.010 3 4 sub hello; 5 while (@ARGV){ 6 given(shift){ 7 when("hello"){hello; } 8 when("hello world"){hello; } 9 when('Hello World'){hello; } 10 when(q{world}){hello; } 11 when(/ \b hello [-\s\W_]?+(?<Name>\w+)/ix){ 12 hello $+{Name}; } 13 when(/ \A (?: false | 0{1}+ [.0]* | \s++ | ) \Z /ix){ 14 hello 0; } # false but defined 15 when(/ null | undef /ix){hello undef } # undef 16 when(/\b hello \b/ix){hello; } #catch others 17 when(/(?<J>j)(?<A>a)(?<P>p)(?<H>h)/ix){ 18 hello("$+{J}ust $+{A}nother $+{P}erl 5.10 $+{H}acker"); 19 } 20 default { say "what '$_'?"; } 21 } 22 } 23 24 sub hello { 25 my ($msg)=@_; 26 state $n=0; 27 $msg //= 'World'; 28 say "Hello $msg", 29 $n++ ? " for the ${n}th time" : ""; 30 }
For more information on Perl 5.10 -
- Perl 5.10 Release note
- Perl 5.10 source On CPAN.
- Ricardo SIGNES (rjbs)'s "Perl 5.10 for "Normal" Programmers" from PPW
- Acme's What's New
- Yves Orton's Perl 5.10 Advanced RegEx's from NPW/DPW/LPW
- ActivePerl binary downloads and
- Strawberry Perl 5.10.0 Release exe installer and announcement
- What's new in Perl 5.10 - 4 micro articles by GABOR.
- Relocatable