in reply to Line number problem with foreach

you mast do this open my $fh,"<test.txt" or die $!; while(<$fh>){ print "$.:$_"; }