Adding some test data:
use List::Util 'shuffle'; my @fileData = shuffle map { "$_\n" } 1 .. 20, (1) x 5; my $linenumber=1; foreach my $line(@fileData) { $linenumber=$linenumber+1; if ($line =~ m/^1$/) { print "$linenumber\n"; } }
Output:
6 7 8 16 17 25
Are you sure you're reading your data correctly?
In reply to Re: Help with regex
by FunkyMonk
in thread Help with regex
by ChuckularOne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |