in reply to how to take a hash reference from main::,
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};
|
|---|