It would probably be better to let the OS tell you why the open failed
by using the $! or $^E variables when you're checking why the open()
failed.  It could be failing because the file was not found, or the file
could be locked somehow, or the user might not have read permissions on
the file.



-----Original Message-----
From: Bedanta Bordoloi, Gurgaon [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 08, 2006 2:24 AM
To: badrinath chitrala; beginners@perl.org
Subject: RE: print file



Try this:

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



<snip: code>



--
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