I think
fletch has nailed this one so I just thought I'd make a general OT observation here about reading files with Perl for your future reference.
Be careful when using code like this:
@lines = <FILE>;. What you're doing here is known as slurping. In other words you are reading the entire file into the
@lines array and thus memory. This may not be a problem with small files but might present a problem when dealing with large files. Consider using the following code for reading files:
my $file = "/path-to/somefile";
open(FIL, $file) || die "Couldn't open $file - $!\n";
while (<FIL>) {
#do stuff with each line of $file
}
close(FIL);
--
vek
--