May be you can follow this simple example and try modifying to see where you are getting the problem:
use Data::Dumper; my %myhash = {}; build_hash(\%myhash); print Dumper(\%myhash); sub build_hash { my $href = shift; my %results = (1,2,3,4);; %{$href} = %results; # print Dumper($href); }

artist


In reply to Re: Preserving hash structure after subroutine call by artist
in thread Preserving hash structure after subroutine call by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":