in reply to Re^2: Help with regex
in thread Help with regex
How are you populating your @fileData array? Is there any reason not to iterate over the filehandle directly?
use strict; use warnings; my $infile = 'whatever'; open my $fh, '<', $infile or die "Couldn't open '$infile' for read: $! +\n"; while ( my $line = <$fh> ) { print "$.\n" if $line =~ m/^1$/; }
|
|---|