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$/;
}