in reply to Returning line numbers of a string
open my $file, '<', "myfilename"; while (<$file>){ next unless /mystring/; print "string found at line $."; } close $file;
|
---|
In Section
Seekers of Perl Wisdom
in reply to Returning line numbers of a string
open my $file, '<', "myfilename"; while (<$file>){ next unless /mystring/; print "string found at line $."; } close $file;
|
---|