Perl 5.10.1 « Perl
Perl 5.10.1
Wednesday 14 October 2009 @ 6:52 am

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
    1. better encapsulation
    2. ordering matters – $key ~~ %hash is OK, while %hash ~~ $key is not.
    3. 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.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • LinkedIn
  • MySpace
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter
  • Twitthis
  • Yahoo! Bookmarks
  • Yahoo! Buzz

See also:

  1. Perl WTFs – last in function
  2. More on foreach localisation
  3. Perl ads here
  4. Utf8 in web perl application (LAMP) – dbi, mysql
  5. Utf8 in web perl application (LAMP) – part 2 – Encode

Tags: ,

Comments (0) - Posted in future by Lech  



Leave a comment