Thanks for your reply Dave.
Now I am getting 'No such file or directory' when i am sure that the file
exists

I changed line 1 to:
$file = "D:/test.txt";

The problem is that the file is there for sure! Sorry to bother you again!

----- Original Message -----
From: "David Gray" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "'Josef E. Galea'" <[EMAIL PROTECTED]>
Sent: Tuesday, April 30, 2002 9:23 PM
Subject: RE: Please Help


> > I am a student an I'm new to Perl. For a university
> > assignment I need to read the contents of a text file in an
> > array. I am using Windows. The code I am writing is:
> >
> > $file = "/test.txt";
> > open (INFO, "$file");
>
> Always check to make sure your filehandle was actually opened:
>
> open (INFO, "$file") or die "couldn't open [$file]: $!\n";
>
> That should help you find the problem.
>
> > @lines = <INFO>;
> > close(INFO);
> >
> > Altough this is supposed to work, I am getting a ''readline()
> > on closed filehand INFO at line 3' message when I interpret
> > it with perl -w. Please Help
>
> Cheers,
>
>  -dave
>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to