Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This is a rephrased version of my previous question.
I can pass a hash of hashes to a function OK:
However I've tried several examples given previously and none work completely
I can pass a hash of hashes to a function OK:
$hash{name} = {date => "00-22-00", city=>"Chicago",}; function (\%hash1); function (\%hash2);
However I've tried several examples given previously and none work completely
sub function { my %hashref=%{shift()}; #the below works ok print $hashref{name}{city},"\n"; # but adding to the hash doesn't work if I print out # the entire hash outside this function $hashref{name}={data1=>"moredata",}; # it does work if I print it out inside the function }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how do I use a hash of hashes reference in a function ?
by merlyn (Sage) on Sep 22, 2000 at 21:53 UTC | |
by Fastolfe (Vicar) on Sep 22, 2000 at 23:45 UTC |
Back to
Seekers of Perl Wisdom