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

Re: RFC: "Best Practices" code review section

by trammell (Priest)
on Aug 04, 2005 at 22:48 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://481035]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-19 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found