Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Answer: undef vs. $foo = 0

( #163711=categorized answer: print w/ replies, xml ) Need Help??

Q&A > input and output > undef vs. $foo = 0 - Answer contributed by crazyinsomniac

The best method is
foreach $foo(@foo) { $bar = $some + $thing; }
no need for an intermediary step unless you're doing something with $bar.

If $bar has a default value, set it to that value, otherwise undef.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2016-08-24 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (348 votes). Check out past polls.