might abort the assignment if $b is not true. I can't test it at the moment. Another idea that occurs to me is{ $a->{'b'} = do {$b or last} }
which expresses pretty directly what you said in your last sentence.($a->{'b'} = $b) or delete $a->{'b'};
In reply to Re: Shortcut operator for $a->{'b'}=$b if $b;
by Roy Johnson
in thread Shortcut operator for $a->{'b'}=$b if $b;
by rokadave
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |