my $finished_1, $finished_2; # should be: my ($finished_1, $finished_2); # list context is needed for the "my" to apply to # both variables. chomp $line1, $line2; # the chomp() does not operate on $line2. # Again, list context is needed... # chomp ($line1, $line2); # but that requires a change in the print # # e.g., print "$line1 \t $line2\n"; # # Of course code could be just: # chomp $line1; #leave $line2 out of it! # My coding preference would be to be symmetrical, # i.e. # chomp ($line1, $line2); # and add the extra $line2 line ending back in # during the print. # # instead of: print "$line1 \t $line2"; # print "$line1 \t $line2\n";