in reply to File Handling problem

i solved the problem by using open (FH_SECOND,"<",\$second_file) or die $!; but can i use the declaration $line_second=<FH_SECOND>; to save the a +line in the variable line_second
Get rid of the backslash:
open (FH_SECOND, "<", $second_file) or die $!;
Now, line_second should contain the first line of your file, which you can confirm by printing it.