in reply to readline() on unopened filehandle
So, Perl tells you that the filehandle is not opened.
Where did you open the filehandle to your file?
See open or maybe use File::Slurp?