in reply to Night of the Day of the Dawn of the Son of the Bride of the Return of the Attack of the Revenge of the Horrors of References and Complex Data Structures

Does your hash have to be global? This should work. I'm not 100% sure becuase I have no where to test it. A good reference is perldsc.
my @array; &callaFunction(); &callaFunction(); &callaFunction(); foreach my $element ( @array ) { my %localHash = %{$element}; # print %localHash's contents } sub callaFunction { my $hash = {}; # fill $key and $value with some random info here $hash->{$key} = $value; push ( @array, $hash ); # if you still need a global hash assign $hash to it here. }
  • Comment on Re: Night of the Day of the Dawn of the Son of the Bride of the Return of the Attack of the Revenge of the Horrors of References and Complex Data Structures
  • Download Code