in reply to Re^3: the variable is lostin thread the variable is lost
See my update above, and implement the advice by applying the following change:
foreach my $filename ( $a, $b ) { open my $fh, '<', $filename or die $!; [download]
Dave