From: Pit Capitain Date: 2006-06-22T15:57:29+09:00 Subject: Re: bug in $. ? Wybo Dekker schrieb: > wybo>cat t > def out; print "#$. "; end # print $. plus a space > out > $. = 0 > out > DATA.each { out } > puts > __END__ > 1 > 2 > 3 > 4 > wybo>ruby t > 7 0 8 9 10 11 > > This should, probably even without the $.=0 statement, print: > 7 0 1 2 3 4 > > Am I wrong? $. is the number of the last line read from the current input file. When you read lines from DATA, you're reading the lines 8..11 of your file "t". Why do you think line 8 should be reported as line 1? Regards, Pit