Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: "open" Best Practices

by VinsWorldcom (Prior)
on Jul 11, 2019 at 16:05 UTC ( [id://11102695]=note: print w/replies, xml ) Need Help??


in reply to "open" Best Practices

Thank you! Can't say I've always done that in the past (although I've been using the 3-arg form for..?ever?). The "or die" with $!:

open my $fh, '<', $file or die "$0: cannot open $file: $!";

has been updated in my quick snippets!

UPDATE: removed extra semicolon after first line - thanks haukex

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 17:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found