Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: RFC: "Best Practices" code review section

by trammell (Priest)
on Aug 04, 2005 at 22:48 UTC ( #481035=note: print w/replies, xml ) Need Help??


in reply to RFC: "Best Practices" code review section

A better practice is to put $filename (or similar) in some sort of delimiter in the die() call, like this:
open(my $fh, '<', $filename) or die "can't open '$filename': $!"
This gives you a handle on edge cases where e.g. $filename has trailing whitespace.

Log In?
Username:
Password:

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

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















    Results (175 votes). Check out past polls.

    Notices?