News for hackers. Stuff that matters.
Re:How to read Haskell like Python by tikhonj on Monday November 14, 2011 @08:58PM (#3236606)
How about this:

    map{
      tr/a-z/A-Z/;
      print $_
    }@array;
I don't remember the exact syntax, but the tr acts on $_ by default, and $_ starts out as each element of the array.
Re:How to read Haskell like Python by draegtun on Tuesday November 15, 2011 @05:54AM (#3237798)
In map, $_ is a localised reference. Thus it doesn't clobber $_

    my @array = qw/one two three/;
    $_ = "Hello";
    say;
    map { tr/a-z/A-Z/ } @array;
    say;
prints....

  Hello
  Hello
However remember it's a reference so using tr// will update @array...

  say "@array";    # => ONE TWO THREE