in reply to readline() on close filehandle $handle

Use the helpful advice above from Corion above or prepend use Fatal qw(open close); to your code.
--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]