From: Toby Hutton Date: 2001-01-30T13:55:02+09:00 Subject: [ruby-talk:10104] A parsing bug? Hello, I have another potential parsing bug (or of course I don't understand what I'm doing). I have a file with a section that contains a string count and then a bunch of null terminated strings one after the other. I'm reading them all one by one and putting them in an array. ((fp.read 4).unpack "l")[0].times do names.push (fp.gets "\0").chop # <- line 39 end Produces: ./parseBlend.rb:39: private method `chop' called for ["*next\000"]:Array (NameError) from ./parseBlend.rb:38:in `times' from ./parseBlend.rb:38 "*next" is the first string in the file. But: ((fp.read 4).unpack "l")[0].times do names.push fp.gets("\0").chop end Works fine. The distinction is (fp.gets "\0").chop vs. fp.gets("\0").chop. Shouldn't they both work? -- Toby.