1. 2
  1.  

  2. 1

    Great bit of puzzling out an odd new feature. Perhaps Ruby is trying to edge out Perl for the biggest set of odd little perfect-for-one-odd-corner-case tools. Personal favorites: the flip-floperator and __END__/DATA.

    Oh, and seeing the ~ in this reminds me of the really crazy one: Regexp#=~ creates local variables from named captures:

    /(?<bar>\w+)/ =~ 'foo'
    puts bar # prints 'foo'
    

    I learned that one because it’s a bit of landmine, actually…