Well, the perl 5.10.1 was released some time ago. It includes some nice features and some strange features.
I’m osting it in “future” category, as I do not intend to use it now. Neither 5.10. Why? It is being changed, and I like language I develop in to be more constant
Nice:
- bug-fixes, optimisations, tuning. Runs faster.
- autodie pragma
Strange:
- “..” operator is interpretedin boolean context when used inside a when statement – yet another WTF. So, the behaviour of “..” is not less consistent. On the other hand it may be usefull.
- Change of smart match behavior in comaprison to 5.10
- better encapsulation
- ordering matters – $key ~~ %hash is OK, while %hash ~~ $key is not.
- distributive – applies itself recursively across data structures. Isn’t it getting too smart? And too complex to understand in real code? And too WTFish? I’ll quote the fragment of perl tips newsletter from http://perltraining.com.au/
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.
See also:
- Perl WTFs – last in function
- More on foreach localisation
- Perl ads here
- Utf8 in web perl application (LAMP) – dbi, mysql
- Utf8 in web perl application (LAMP) – part 2 – Encode

