You're reading from the wrong filehandle (a bug you inherited from the original code).
See the Copyright notice on my home node.
Perl training courses
In reply to Re^2: hash as subroutine argument by davorg in thread hash as subroutine argument by Anonymous Monk