Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Or, Or, Equals Zero, $x ||= 0

by eric256 (Parson)
on Nov 27, 2007 at 23:08 UTC ( #653410=note: print w/replies, xml ) Need Help??


in reply to Or, Or, Equals Zero, $x ||= 0

$x = undef; $x ||= 0; print $x;

That is the same as $x = $x || 0 (which is read $x or 0) and is used for defaulting values.


___________
Eric Hodges

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2023-02-07 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (39 votes). Check out past polls.

    Notices?