$file is the file name. You need to read from the file handle ($fh).
In reply to Re: Unopened Filehandle Problem by steves in thread Unopened Filehandle Problem by monkfan