|
|
| Do you know where your variables are? | |
| PerlMonks |
Re^4: Shortcut operator for $a->{'b'}=$b if $b;by leriksen (Curate) |
| on Sep 20, 2005 at 23:24 UTC ( [id://493648]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Maybe someone can suggest how to define a '?=' operator $a->{'b'} ?= $b; assigns $b to $a->{'b'} if $b is defined, does not autovivify $a->{'b'} if $b not defined is that possible? - I'm thinking of use overload but I dimly recall that there is a finite set of operators you can overload and ?= isnt one of them. ...reality must take precedence over public relations, for nature cannot be fooled. - R P Feynmann
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||