in reply to O, the horrors of references and complex data structures

As an alternative to copying the hash every time, I'd prefer to ditch the global variable and pass a hash reference to all the subroutines (depending on the size of the hash, it could be worthwhile efficiency-wise), something like:
: while($not_done) { my %hash; sub1(\%hash); sub2(\%hash); push @AoH, \%hash; } sub sub1 { my $href=shift; $href->{key}="value"; } sub sub2 { my $href = shift; # Mess with href some more }