my $line = 0; my $file = "file.txt"; open (FILE, $file) || die "Could not open $file\n"; while (<FILE>) { print "I am on line ", ++$line, "\n"; } close (FILE);
In reply to Re^2: Determining what line a filehandle is on
by tadman
in thread Determining what line a filehandle is on
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |