rbm1213 has asked for the wisdom of the Perl Monks concerning the following question:
#declare hash in main my %myhash; #require the autoloaded modules: require ${modulename}; require ${usermodule}; #build the hash in an autoloaded module using a reference: &{${modulename}.'::$modulename'}($param1,\%myhash,\%hash2); #call another autoloaded module that wants to use the hash: &{${usermodule}.'::$usermodule'}($param1,\%myhash,\$array); #in $usermodule, keys to the hash exist: @mykeys = keys %$hashref; # is non-empty array #but any attempt to get hash values produces null. e.g., my $myval = ${hashref}->{$mykeys[0]};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash values missing
by Joost (Canon) on Mar 26, 2008 at 16:41 UTC | |
|
Re: hash values missing
by apl (Monsignor) on Mar 26, 2008 at 16:57 UTC | |
by chromatic (Archbishop) on Mar 26, 2008 at 17:07 UTC |