ActiveState is pleased to announce ActivePerl 5.10.0 Build 1000 Beta,
a beta release of the complete, ready-to-install Perl distribution for
Windows, Mac OS X, Linux, Solaris, and AIX.
This build is based on the first release candidate of the Perl 5.10
source code. Since Perl 5.10 is not yet complete, this build
is designated as a Beta and will be followed by a final build once
Perl 5.10 is officially released.
Please use this beta build to try out new features in Perl 5.10 and to
test source level compatibility of your existing Perl code under this
new release (note that Perl 5.10 is not binary compatible to earlier
releases).
For detailed information or to download this beta release, see:
http://www.activestate.com/Products/..._download.plexNew in ActivePerl 5.10.0 Build 1000 Beta
========================================
Some exciting new features to look for:
* The new switch statement and smart-match operator
The new smart-matching operator ~~ compares two expressions with each
other; the exact nature of the match is being determined by the types of
both expressions: matching a string and hash will return if the hash
contains a key equal to the string; matching a regular expression
against an array will return if any element of the array matched
successfully against the regexp etc.
The new switch statement will smart-match a single expression repeatedly
against a list of other expression until one matches. For example:
given($foo) {
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 '$foo is numerically less than 100';
}
default {
die q(I don't know what to do with $foo);
}
}
* Defined-or operator
The new defined-or operator // allows you to write
$a // $b
instead of repeating the first argument as in
defined $a ? $a : $b
Also the statement
$c //= $d;
can now be used instead of
$c = $d unless defined $c;
* Many improvements to the regular expression engine, including:
The regular expression engine is no longer recursive, meaning that
patterns that used to overflow the stack will either die with useful
explanations, or run to completion, which, since they were able to blow
the stack before, will likely take a very long time to happen.
- It is now possible to write recursive patterns that are easy to read
(for a regular expression), and are executed in an efficient manner.
- It is now possible to name capturing parenthesis in a pattern and
refer to the captured contents by name. The naming syntax is
(?<NAME>....). It's possible to backreference to a named buffer with
the \k<NAME> syntax. After the match the named capture groups are
accessible via the %+ hash:
my $value = "foo 42";
if ($value =~ /^(?<name>\w+) \s* (?<number>\d+)$/x) {
say "Name $+{name} and Number $+{number}";
}
- possessive quantifiers
- backtracking control verbs
- relative backreferences
Other new features include:
* new say() function
* lexical $_ variable
* _ prototype
* UNITCHECK blocks
* state variables
* stacked filetest operators
* byte-order modifiers for pack() and unpack()
* Many bug fixes
* Additional core modules
* Extended documentation
Download ActivePerl 5.10.0 Build 1000 Beta now:
http://www.activestate.com/Products/..._download.plexGetting Started
===============
Whether you're a first-time user or a long-time fan, our free resources
will help you get the most from ActivePerl.
Mailing list archives:
http://aspn.activestate.com/ASPN/Mai...ded/ActivePerlFeedback
========
Everyone is encouraged to participate in making Perl an even better
language.
For bugs related to ActiveState use:
http://bugs.activestate.com/enter_bu...p;version=1000 For bugs related directly to Perl please use the 'perlbug' utility.
Enjoy!