Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How to verify a file handle?

by c (Hermit)
on Oct 02, 2001 at 20:05 UTC ( [id://116168]=note: print w/replies, xml ) Need Help??


in reply to How to verify a file handle?

I think that the or die statement will do what you want, however if you would like the script to continue on if the file doesnt exist rather than exiting, you may want to try testing for the file using -e. Check out this, or just try

if (-e $filename) { open(FH, $filename); }

humbly -c

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://116168]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-24 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found