foreach $file (@files) { open my $FH, '<', $file or die "$file open says $!"; while (<$FH>) { ponder($_); $transactionHash{$threadID}{oldVariableName} = $stuff; delete $transactionHash{$threadID} if $transactionEnded; } }