in reply to Referencing an array in a complex hashed data structure

Wherever you have {WA{ replace it with {$WA{.

You can clean up code like this a lot if you create a temporary variable:

sub reportWA{ # $key my $key = shift; my $NewWA; my $stags = $WA{$key}{stags}; unshift @$stags, $WA{$key}{PT}; #insert PT at [0] -line 110 $NewWA=$WA{$key}{PT}; # $periodTotal * 1 $#$stags = $rnds-1; # truncate off oldest stage for my $i (1..$rnds-1){ $stags->[$i] *= 10; #stag[n] = initial * (wght**n) $NewWA += $stags->[$i]; } $NewWA /= $rnds; printf " %d %d %8.2f %s\n" , $key,$WA{$key}{PE} ,$NewWA, join (", ",@$stags); }

Perl's payment curve coincides with its learning curve.