If $main::session alread holds a reference to a hash, then just assign that value (the reference) to the new variable (do not introduce another level of references):
%main::hash = (one => 1, two => 2, three => 3); $main::session = \%main::hash; my $session = $main::session; print $session->{two};
In reply to Re: how to take a hash reference from main::,
by danger
in thread how to take a hash reference from main::,
by rfb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |