in reply to hashes of arrays ??

Is it possible that some blank lines exist, or header or footer lines that don't have all the fields?

That happens pretty often in files I deal with. In that case, you have 2 options.

If none of the header/footer/blank lines have all the fields, you can just do

if(@array>14) { print STDOUT "$array[13]\t$array[14]\n"; print OUTFILE .... }
(assuming you open OUTFILE above the loop, and want to write all these items to it, as someone else suggested...)

If you have a "header" type line, or line of dividers or something like that, then you'll have to add some checks to skip this, like:

while(<FILEHANDLE>) { next if /------/; # skip divider line next if /SALES/; # skip header line next if /TOTAL/; # skip summary line next if /^$/; # skip blank lines ... }
with the correct regular expressions for your data, of course. Make sure that SALES can never appear on a normal line, for instance, if you're going to use that as a screen.

Hope this helps!
--
Mike