It seems like you got everything. Except I want to make
sure you realize that
$. is the number of
lines (or more precisely "the number of records") you've read
from your input file, not the line number of the program. So if you're
thinking that it equals 3 because it's the third line
of your program, that's not right. If you're not reading
from any input files, it should be 0.
(Though I do note that $. increases as I use
the debugger...)
Update: Actually it seems to be undef when I try it
before reading input lines, not 0.
buckaduck