Brian Candler wrote:
> 
> You need to boil this down to a minimal test case which demonstrates the 
> problem. As you boil it down, you'll probably find the problem yourself. 
> If you don't, then you'll have a <10 line program that you can paste 
> here, that we can run, and we can explain any bits of it that you don't 
> understand.
> 
> Try using 'puts x.inspect' instead of 'pp x' - it may be clearer what's 
> going on.

I was looking in the wrong place.
As it turns out, this happens:

["haha", "baba", "kate"].each do |x|
  x.gsub! "a", "i"
end

actually changes the array - so my save code was modifying the data I 
had opened.
-- 
Posted via http://www.ruby-forum.com/.