in reply to Help with regex
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with regex
by ChuckularOne (Prior) on Sep 28, 2007 at 16:40 UTC | |
by gam3 (Curate) on Sep 28, 2007 at 17:28 UTC | |
by Not_a_Number (Prior) on Sep 28, 2007 at 16:52 UTC |