Bug-fixes and optimisations

Perl 5.10.1 is primarily a maintenance release, which means a
large collection of bug-fixes, optimisations, additional tests
and tuning. In particular, 5.10.1 runs significantly faster
than 5.10.0 with many common subroutine calls.

If you're already using 5.10.0, you may find that upgrading
to 5.10.1 will give your code a significant speed boost.

Range operators

Perl's .. operator is now always interpreted as being in boolean
context when used inside a when statement. In practical terms,
this now means that structures like the following now work:

Under Perl 5.10.0, the header skipping code above would never trigger,
however under 5.10.1 it now works as intended. To use given/when
to match a range, an array reference should be used (in both
5.10.0 and 5.10.1):

Smart-match

Perl 5.10.1 introduces significant changes to the ~~, the smart-match
operator. The most important changes are detailed below:

Better encapsulation

Smart-match no longer works on objects unless they have overloaded the
smart-match operator. This prevents smart-match for breaking encapsulation
and poking around in the internals of your objects when you don't want
it to. Objects that don't overload smart-match, but do overload
stringification or numerification, will be treated as strings
or numbers, respectively.

No longer commutative

In Perl 5.10.0, the ordering of the operands to smart-match did not
matter. In 5.10.1, they do matter, with the rightmost argument
primarily determining behaviour.

Distributive

Where possible, the new smart-match is distributive, and will
apply itself recursively across large data structures. For example,
the following expression is true when evaluated under 5.10.1, but
false under 5.10.0:

'bar' ~~ [ 'foo', [ 'bar', 'baz' ], 'qux' ]

In the same vein, given the following code:

[ 'foo', 'bar', 'baz' ] ~~ \&subroutine

Perl 5.10.1 will call the subroutine three times (once for each
element), and the whole expression will be considered true if all
the results are true. On the other hand, Perl 5.10.0 would call
the subroutine only once, passing in the whole data structure.

autodie

Perl 5.10.1 includes the autodie pragma as part of the distribution,
meaning it can now be used out-of-the-box in new code. Using
autodie causes Perl's built-ins to succeed or die, meaning
you can write code like the following: