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.
|
---|
In Section
Seekers of Perl Wisdom