Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: checking bareword-filehandle

by davido (Archbishop)
on Aug 06, 2012 at 16:42 UTC ( #985771=note: print w/ replies, xml ) Need Help??


in reply to checking bareword-filehandle

Checking a filehandle is problematic. Why not change your open to something like this:

open FH, '<', 'filename' or do { $failed = 1; warn $! };

Now you've got a reliable Boolean variable rather than fragile hackish testing of the filehandle.


Dave


Comment on Re: checking bareword-filehandle
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2015-07-31 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (275 votes), past polls