http://qs321.pair.com?node_id=430560


in reply to Adding scalars but with a twist..

This can easily be done using eval(), even under strict:
use strict; my $a1 = 3; my $a2 = 4; my $a3 = 5; my $sum = 0; for ( 1..3 ) { eval "\$sum += \$a$_"; } print $sum;
p.s.
i personally would prefer to rewrite the script you have to update (as stated in previous post), because not doing so is false lazyness in my eyes.
holli, /regexed monk/