I am working with two files, so as I loop through one I need to look through part of another one, and the information I encounter in it will be sequential. So I thought the best way would be to keep track of the line number:
open(PARSED, "< file.txt") or die$!;
my @parsedFile = < PARSED >;
my $line = 0;
my $size = @parsedFile;
# This next part is in a loop, but the only important thing is this next line
print $parsedFile[$line];
Even as the value of $line increases, it prints nothing but if I do the following there is no problem:
I have even tried a number of variations of trying to pull individual lines from @parsedFile but with no luck.
foreach (@parsedFile){
print $_;
}