ChuckularOne has asked for the wisdom of the Perl Monks concerning the following question:
I have been digging and digging in the archives here and in Programming Perl and in Mastering Regular Expressions to no avail.
I am parsing a file into a list and the foreach-ing through that list.
I'm trying to find out if any lines contains only "1\n" (Which is what several hundred lines contain.)
I am using the following code:
What am I doing wrong!?!$linenumber=1; foreach $line(@fileData) { $linenumber=$linenumber+1; if ($line =~ m/^1$/) { print "$linenumber\n"; } }
Back to
Seekers of Perl Wisdom