From: Peter Bailey Date: 2006-09-27T23:52:14+09:00 Subject: problem with ".scan" RUBY's complaining about the following 3 lines of code. I've got it in a new program, but, I copied it directly from an older, working program. Can someone help me understand what's the problem with the "scan" line, or, apparently, the "each" line? Thanks, Peter 10 Dir.glob("*.ps").each do |psfile| 11 file_contents = File.read(psfile) 12 file_contents.scan(/\%\%Pages: (\d{1,5})[ ]+\n/) do Error message: E:/PageCounts/test1.rb:12:in `scan': string modified (RuntimeError) from E:/PageCounts/test1.rb:12 from E:/PageCounts/test1.rb:10:in `each' from E:/PageCounts/test1.rb:10 -- Posted via http://www.ruby-forum.com/.