for my $file (keys %fh) will (or should) be slower then while (my ($file, $data) = each %fh)

In reply to Re^2: Performance Trap - Opening/Closing Files Inside a Loop by Animator
in thread Performance Trap - Opening/Closing Files Inside a Loop by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":