Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^3: String equality and undef

by webfiend (Vicar)
on Dec 09, 2008 at 16:36 UTC ( #729211=note: print w/replies, xml ) Need Help??

in reply to Re^2: String equality and undef
in thread String equality and undef

Fair point, but you don't really need to worry about the else when your reaction to the if condition is death.

unless ( defined $id ) { die "Why is this ID not defined?"; } # Life goes on normally for everyone else.

And I disagree with your closing, an early return in cases like that is exactly the point. You want to take any steps you can to make the code more readable, especially if it means completely ignoring my initial "switch the logic" comment.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2019-07-20 10:18 GMT
Find Nodes?
    Voting Booth?

    No recent polls found