From: gotoken@... (GOTO Kentaro) Date: 2000-06-14T01:49:17+09:00 Subject: [ruby-talk:03376] Re: chomp! In message "[ruby-talk:03373] Re: chomp!" on 00/06/13, ts writes: > chop (i.e. the global function chop) modify $_ > string.chop (i.e. the method of String) don't modify string > >pigeon% ruby -e '$_ = "abc"; chop; p $_' >"ab" >pigeon% ruby -e '$_ = "abc"; $_.chop; p $_' >"abc" >pigeon% > > This is a feature :-) Wow, I don't know that! Humm .... .... gotcha! str = "abc" $_ = str; chop ; p [$_, str] #=> ["ab", "abc"] $_ = str; chop! ; p [$_, str] #=> ["ab", "ab"] -- gotoken