Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2018-01-19 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (215 votes). Check out past polls.

    Notices?