From: kjana@...4lab.to (YANAGAWA Kazuhisa) Date: 2002-08-10T11:45:33+09:00 Subject: Re: nil || // In message <20020809125049.N11837@atdesk.com> pbrannan@atdesk.com writes: > Why does this not work in Ruby 1.6: > > [pbrannan@zaphod scripts]$ ruby -v -e 'p nil || //' > ruby 1.6.7 (2002-03-01) [i686-linux] > nil > [pbrannan@zaphod scripts]$ ruby-1.7 -v -e 'p nil || //' > ruby 1.7.2 (2002-07-13) [i686-linux] > // No, it works, but completely different way. > ruby-1.6 -e '$_ = ""; p nil || //' 0 > ruby -e '$_ = ""; p nil || //' // Namely 1.6.x treats Regexps in every conditional as implicit matching to $_, whereas 1.7.x stops this special treatment because of an argument almost same to yours. The magic remains for such as `break if /^\s*$/' construct, read the code for more exact information :-) -- kjana@dm4lab.to August 10, 2002 Time is illusion, life is confusion.