Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Shortcut operator for $a->{'b'}=$b if $b;

by ikegami (Pope)
on Sep 20, 2005 at 16:48 UTC ( #493517=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Shortcut operator for $a->{'b'}=$b if $b;
in thread Shortcut operator for $a->{'b'}=$b if $b;

foreach loops sets $_ to refer to the current value in the list which is being iterated. In this case, the list consists solely of $b.

Your expression is equivalent, but it's not an acceptable answer since the question was about removing the need for using $b twice.


Comment on Re^3: Shortcut operator for $a->{'b'}=$b if $b;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2015-07-06 14:19 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 (75 votes), past polls