From: J J Date: 2001-05-08T01:40:03+09:00 Subject: [ruby-talk:14787] Re: Completely freaky behavior Funny how you post and then find the solution. Thanks to Dave! Regards, JJ > I've got a class that sets a variable in a method like so: > @author = nil > later, when the variable is printed: > puts "Author: #{@author}" unless @author.nil? > in fact, @author's value is "= nil" ! if you print the length of > @author, it is 5! > in another method, author is assigned like so: > when /@author\s+(.*)/ > @author = $1 > guess what @author's value is? It is "= $1", the length of @author is 4! > > WTH? > > Any advice? > > I've tried distilling it down to a minimal test, but can't. If you'd like to > see the whole thing, drop me a line. > > Thanks, > JJ > > -- > Be Kind, Be Careful, Be Yourself > -- > Solid, reliable software at reasonable prices > http://www.johnjohnsonsoftware.com > > > > >