http://www.perlmonks.org?node_id=1016809


in reply to Re^5: help with error 'readline() on unopened filehandle'
in thread help with error 'readline() on unopened filehandle'

Also, 3 argument open is safer than 2 argument open -- sure you hardcoded the filename, but the OP hasn't