[Chicago-talk] What does dollar sign followed by a period represent?

Steven Lembark lembark at wrkhors.com
Mon Jan 8 20:36:03 PST 2024


On Sat, 23 Dec 2023 16:59:24 -0600
Andy Lester <andy at petdance.com> wrote:

> It’s the current line number.  See “perldoc perlvar”

Not quite. It's the current line from the currently open file. If
you are reading from mutliple files on stdin using readline, for
example, it's not monotonic. In particular it cannot be used to 
identify the line read for an error unless you also dump the file 
from which the last filehandle read is open to. Not referencing the
input file with $. is a common mistake. 

-- 
Steven Lembark
Workhorse Computing
lembark at wrkhors.com
+1 888 359 3508


More information about the Chicago-talk mailing list