From: Peter Bailey Date: 2007-09-21T23:39:04+09:00 Subject: gsub not working. Ruby thinks I'm in an array? I've chunked up a huge text file into arrays of discrete text groups. I want to go into each of those text groups and convert a bunch of stuff. I've proved that I've got my array OK, and, I've proved that I can do a "put" of any of the discrete text groups. But, in my first gsub! to convert stuff in these text groups, Ruby is complaining that I'm doing a gsub! in an array. I'm getting the following error message: Exception: private method `gsub' called for # Here's the lines where this starts: registries = [] registries = xmlfile.scan(/(.*? )<\/registration>/im) #puts registries[100] registries.sort! registries.each do |registry| registry.gsub!(/<\/*registrationList>/, "") Can someone help me understand what's going on here? Thanks, Peter -- Posted via http://www.ruby-forum.com/.