Click to See Complete Forum and Search --> : Open a file in Perl


mrpatel
January 17th, 2003, 01:53 PM
Hi,
I have a file without any extension, so it's file type is File. How do I open it in perl to read input from that file? It doesn't let me open the file and read from it with the following line:

open( EF, "$each_file" ) or die "can not open a file $each_file\n";

and I get the following output on the cmd prompt:

can not open a file temp


Any Idea?

Thanks,
-Mehul

Manish Malik
January 18th, 2003, 02:05 AM
Are you sure that file entry called 'temp' exists and is not a directory?

That error usually indicates that it was not able to find a valid file with that name, and remember that a new file does not get created if you try to open it for input.