in reply to Parsing a file one line at a time

This is wrong:
while (<FILE1>) { # this @lines = $_; }

Perl is expecting a list, and all you do is assign a scalar. You have to use push to append the $_ onto the array:
while(<FILE1>) { push @lines, $_; }

or, faster:
@lines = <FILE1>;


-- ar0n