in reply to Line number problem with foreach
open my $fh, "test.txt" or die $!; while(<$fh>) { print "$.:$_"; } __END__ outputs: 1:First line 2:Second line 3:Third line 4:Fourth line
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Line number problem with foreach
by vinoth.ree (Monsignor) on Feb 28, 2009 at 04:44 UTC |