Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 musing on the Monastery: (4)
As of 2020-02-17 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (70 votes). Check out past polls.

    Notices?