bleadperl is out there

by Adriano Ferreira

The 5.9.5 release of Perl was announced today and may be downloaded at your nearest CPAN mirror. This is a release from the development branch of the Perl interpreter, also known as "perl-current, bleading edge perl, bleedperl or bleadperl".

3 Comments

John Drago
2007-07-09 09:58:05
This distribution has a huge accumulated set of long waited-for features, some of them backported from Perl 6.

I see that we have a new switch construct, but how about an example?

Thanks!
Adriano Ferreira
2007-07-09 12:58:39
@John Drago:

I could not provide a better example than one given by Ricardo Signes at the ABE.pm mailing list. His message is well worthy reading, explaining why Perl never got a dumb switch and why this new construction is a switch on steroids.



given ($variable) {
when (1) { # $variable == 1
do_something_one;
}
when (@edge_cases) { # if $variable in @edge_cases
do_edge_case_handler;
}
when ($_ > 10e6) { # if $variable is over a million
do_huge_handler;
}
when (\&test) { # if test($_) is true
say "the test was true!";
continue;
}
when (/^\Q$somepattern\E$/) {
say "seen $somepattern";
continue;
}
default {
default_handler;
}
}


The example is augmented by a clause suggested in a reply from the same thread as the original message.

Robert
2007-07-11 18:33:12
I for one will be very excited when 5.10 finally hits the streets. I have a project coming up for a re-write that I would love to use 5.10 for.