Special File Handling Variables
Learn about the special file handling variables in Perl.
We'll cover the following...
$. or line counter
For every line read, Perl increments the value of the variable $., which serves
as a line counter.
Press +  to interact
Perl
Files
open my $fh, '<', 'some_file';while (<$fh>) {print " $.";}
$/ or line-ending sequence
readline uses the current contents of $/ as the line-ending sequence. The value
of this variable defaults to the most appropriate line-ending character sequence
for text files on our current platform. The word line is a misnomer, however.
$/ can contain any ...
 Ask