my $fh = new FileHandle($fileName,">"); if (! defined $fh) { print STDERR "Error reading $fileName\n"; exit(2); } my ($bh,$fh,$ft); while (my $line = <$fh>) { chomp($line); if ($line =~ /^BH/) { $bh = $line; } elsif ($line =~ /^(F[HT])/) { eval("\$" . lc($1) . " = $line"); next; } elsif (defined $bh) { callSub($line,$bh); } } close($fh);