From: 7stud -- Date: 2011-05-01T07:06:37+09:00 Subject: Re: Must be my bug, but it looks like Ruby's could it be? RichardOnRails wrote in post #995908: > I know my Subject line looks like heresy in this newsgroup, but I > can't figure out how I'm screwing up in this bug. > > I posted the program at http://www.pastie.org/1849430 > It reads in a little control data, which is displayed at > http://www.pastie.org/1849434 > > The program reads in the control data and stores it in hash containing > two hashes in this case, which represents the two pseudo-hashes in the > control data. > > My problem is conflicting output by the statements numbered 155 & 156: > puts %[%d\t%s => %s] % [num+=1, key, value] I know about ruby's % substitutions, but I can't decipher that line--you have obfuscated the code very well! Not a good thing. I would write that line as: puts "%d\t%s => %s" % [num+=1, key, val] lol. You are using the % shortcut for %Q and you are using [] as the delimiter. I have only one thing to say: horrible code writing. -- Posted via http://www.ruby-forum.com/.