in reply to reading file into an array
Array indexes in Perl begin with zero, so that's actually going to start at line 15.for(my $x=14; $x<@fileContents; $x++)
Also, a more perlish way of initiating that loop would be:
However, a much better way to process a file line by line is with a while loop. Something like this:for (13 .. $#fileContents) { print "$fileContents[$_]\n"; # Or whatever }
my $lines_to_skip = 14; while (my $line = <$file>) { # $. will give you the current line number of the file next if ($. <= $lines_to_skip); chomp($line); # Do stuff with $line }
Hope this helps,
Darren :)
In Section
Seekers of Perl Wisdom