It's already barebone as it is, as far as I can tell. The only idea that comes to my mind is to delay print
calls by building up a message string, and print it just once at the sub end. Depending on the amount of memory available (and output expected) it might get you a tiny little bit of speed increase, if your $fh is opened on disk.