Help for this page
push(my @file2, $_);
my @file2; # scope it OUTSIDE of your block while (<FILE2>) { ... # ... print FILE3, @file2; # prints all elements