More than likely
1.) the file doesn't exist
2.) you don't have read permissions

You might have meant "./test.txt" which will read the file from your current
directory instead of the root directory.
----- Original Message -----
From: "Josef E. Galea" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 30, 2002 3:27 PM
Subject: Please Help


Hi
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");
@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




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

Reply via email to