my @array; my %hash=(foo => 2, bar =>3); for (1..4) { push @array, {%hash}; %hash=(%hash, map { +"$_^2" => $hash{$_}**2 } keys %hash); }