Am I rignt in "~, More" is incorrect?

Ralph

From: Lyle Johnson

FWIW, I just tried this with Ruby 1.7 (MSWin32 version on Windows) and got
the same result for both -- but it was the first result ("~, More") and not
the one you got from your IRB session.
"Ralph Mason" <ralph.mason / telogis.com> wrote in message
news:12eb01c1e0e7$163258b0$0101a8c0 / p3...
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