Re: opening a file



cartercc <cartercc@xxxxxxxxx> wrote:
On Jan 7, 9:50 pm, George <geo...@xxxxxxxxxxxxxxx> wrote:
I thought I would use perl instead of fortran to parse a text file, what
with the new m// s/// capabilities at my fingertips.

Easy, easy, easy ...

open INFILE, "<nameoffile.txt";

Most people would suggest to use the three-argument form of open:
open INFILE, '<', 'nameoffile.txt';

Almost all people would strongly suggest to test for failure:
open INFILE, '<', 'nameoffile.txt' or
die "Cannot open nameoffile.txt because $!\n";

jue
.