Try this:

open(FILE,"f:/file.txt") || print("open() failed as file did not exist.\n");

while (<FILE>){
        print $_;
}

Bedanta

-----Original Message-----
From: badrinath chitrala [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 08, 2006 2:46 PM
To: beginners@perl.org
Subject: print file

Hi

open FILE, "file.txt" or die $!;
while (<f:/file.txt>)

Sombody please tell me why do i get the message as below if i want to print
the contents of text file

Name "main::FILE" used only once: possible typo at nl.plx line3.
1:f:/file.txt

and my file is not executed (i did not get the output)

regards
Badrinath

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to