From: Wybo Dekker Date: 2006-06-22T18:46:48+09:00 Subject: Re: bug in $. ? Pit Capitain wrote: > DATA does indeed "point to" the input file, right after the __END__. You > can verify this for example by calling DATA.rewind. After that, you can > read the text before the __END__. Sure, but that is part of the bug, in my opinion. After DATA.rewind I want to see the first line of the DATA section again. If I want to see the program source, I can use $0 >> 2. As is, $. is useless when reading from DATA > > Why do you need $. to start from 0 when reading from DATA? What is it > that you're trying to do? In this case, I wanted to skip the first line: next if $.==1 But it can, for example, also be used to errors in the DATA section: raise("illegal key in line #{$.} of the DATA section") -- Wybo