Ralph Mason wrote:

> This must be something I am doing wrong.  In a file the output from this
> 
> x = "\"CommaTest, After\", More"
> x.gsub!(/\"(.*),(.*)\"/,"#{$1}~#{$2}")
> p x
> 
> is
> 
> "~, More"
> 
> 
> Run from IRB the output is
> 
> irb(main):047:0> x = "\"CommaTest, After\", More"
> "\"CommaTest, After\", More"
> irb(main):048:0> x.gsub!(/\"(.*),(.*)\"/,"#{$1}~#{$2}")
> "CommaTest~ After, More"
> irb(main):049:0> p x
> "CommaTest~ After, More"
> nil
> 
> What is going on here?
> 
> Thanks for any help
> Ralph
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

using ruby version: ruby 1.7.2 (2002-02-22) [i686-linux]

"~, More"

is the output from irb or from within a file


~mm