News for hackers. Stuff that matters.
Re:Cryptic Ruby Global Variables and Their Meanings by draegtun on Monday September 17, 2012 @07:33AM (#4532067)
Especially when Ruby has no way of scoping these variables... unlike Perl:

  {
      # level 1
      local $\ = "[1]\n";
      some_print_operation();
  
      {
          # level 2
          local $\ = "[2]\n";
          some_print_operation();
      }

      # level 1 again
      some_print_operation();
  }

  # $\ back to what it was before all this :)

There are no comments on this comment yet.