Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: "open" Best Practices

by VinsWorldcom (Prior)
on Jul 11, 2019 at 16:05 UTC ( #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
Node Status?
node history
Node Type: note [id://11102695]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2020-05-31 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?