Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: What does this mean?

by Anonymous Monk
on Aug 21, 2012 at 07:04 UTC ( #988606=note: print w/ replies, xml ) Need Help??


in reply to Re: What does this mean?
in thread What does this mean?

defined $id and $$self{_id} = $id; or with newer perls $$self{_id} //= $id;


Comment on Re^2: What does this mean?
Select or Download Code
Replies are listed 'Best First'.
Re^3: What does this mean?
by moritz (Cardinal) on Aug 21, 2012 at 07:14 UTC
    $$self{_id} //= $id; checks the definedness of $$self{_id}, not of $id (as the other suggested snippets do), so it does something completely different (never reset the attribute, instead of prevent assignment of an undefined id).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2015-07-29 19:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (267 votes), past polls