From: Michael McDaniel Date: 2002-04-12T03:16:21+09:00 Subject: Re: Am I going mad? Works in IRB not in a file! R.Seymour wrote: > Here is what I got using ruby 1.6.6 on Linux: > > In a file: > > rich@puff:~/ruby$ ruby commatest.rb > "~, More" > > > In IRB: > > irb(main):001:0> x = "\"CommaTest, After\", More" > "\"CommaTest, After\", More" > irb(main):002:0> x.gsub!(/\"(.*),(.*)\"/,"#{$1}~#{$2}") > "~, More" > irb(main):003:0> p x > "~, More" > nil > > So in my case, it was the same output, but not the same as 1.7.2! :) > > -Rich ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Apologies for any confusion I may have caused. I _did_ have same result with v1.7.2 as Rich is showing here. I mistakenly did not mention the 'nil' which is the current output record separator; the 'nil' only prints to stdout when using irb, not from within a script. ~mm