Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Answer: undef vs. $foo = 0

by crazyinsomniac (Prior)
on May 03, 2002 at 05:11 UTC ( #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?
[Lady_Aleena]: Your Mother, how would that work? I'm having a hard time understanding the pod.
[Your Mother]: $dir->chidren, grep {} $file->slurp &c &c. :P

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-05-23 19:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?