in reply to Preserving hash structure after subroutine call

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

Replies are listed 'Best First'.
Re: Re: Preserving hash structure after subroutine call
by Anonymous Monk on May 13, 2003 at 21:38 UTC
    I've used the method in your example extensively to initialise hashes and never had any problem with it. For some reason (scope?) it just doesn't seem to work when the fetchrow_hashref method is involved.