in reply to extracting single column

The solution is to learn Perl, and to understand what you are doing. Seriously, you can't just make up some syntax and hope that perl will magically convert it into a running, correct program.

Check perlsyn or perlintro for the syntax of the foreach loop.

Writing to FINAL (which you've not opened) is going to be disappointing at run time. use warnings; will catch that (see perllexwarn), and please enable use strict; too. See for example RFC: Tutorial: use strict; now what!? for instructions.