in reply to Line number problem with foreach
This is equivalent to while(<>) { ... }
use strict; use warnings; open my $fh, "test.txt" or die $!; foreach (;<$fh>;){ print " $. :$_ \n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Line number problem with foreach
by roho (Bishop) on Feb 28, 2009 at 21:56 UTC | |
by AnomalousMonk (Archbishop) on Mar 01, 2009 at 04:30 UTC | |
|
Re^2: Line number problem with foreach
by churchmice (Initiate) on Feb 28, 2009 at 13:43 UTC |