Nice to see that quantified, thanks!
A similar optimization can be set up when map or a for loop is applied to the values of a hash or elements of an array,
my $total; $total += $_->{'cost'} for @{$struct[3]{'baz'}[42]};
After Compline,
Zaxo
In reply to Re: Perl and common subexpressions
by Zaxo
in thread Perl and common subexpressions
by Stevie-O
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |