Gani Ruthellen wrote: > Given: > lines = file.readlines("\x15") # don't ask :) > lines.each do |y| > y.chomp!("\x15") > y.sub!(/^\n/,"") #kill off the extra line feeds I would think it better to just call y.chomp! here (with no argument). > if y =~ /^\*\*\*/ then > y = "<someTag>" + y + "</someTag>" Know that this is actually rebinding the local variable y to point to a new object, not modifying the old object. If your goal was to modify the array "lines", you should change "lines.each" to "lines.map" and make sure you end the block with a statement that returns the modified y. perhaps: lines.map do |y| y = y.chomp("\x15").chomp y = "<someTag>" + y + "</someTag>" if y =~ /^\*\*\*/ y end Dan