Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: if (open(FH, $path)) { ?

by jdporter (Paladin)
on May 03, 2004 at 14:12 UTC ( [id://350012]=note: print w/replies, xml ) Need Help??


in reply to if (open(FH, $path)) { ?

Well, it's fine, but one tweak I would make is to add the $! variable (and maybe the filename) in the error message, e.g.
print "Can't open $filename for reading - $!";

Replies are listed 'Best First'.
Re: Re: if (open(FH, $path)) { ?
by bkiahg (Pilgrim) on May 03, 2004 at 14:20 UTC
    I would do it that way but I don't want users who don't have access to the file to realize they don't. I'm setting up links to edit the current page.
      In that case, don't print anything if the open fails.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found