In message "[ruby-talk:03373] Re: chomp!"
    on 00/06/13, ts <decoux / moulon.inra.fr> 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 .... <reading string.c> .... gotcha!

  str = "abc"

  $_ = str; chop  ; p [$_, str] #=> ["ab", "abc"]
  $_ = str; chop! ; p [$_, str] #=> ["ab", "ab"]

-- gotoken