sub get_connection { # ... my $sess_id = "Session ID Goes Here"; return MySession::new($sess_id); } # $sess_id out of scope now my $x = get_connection(); my ($p, $q, $str) = MySession::get($x); # internally references PV part of $sess_id #### SV = PV(0x750b78) at 0x777ce8 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x7723c0 "Session ID Goes Here"\0 CUR = 20 LEN = 24 addr of str: 0x7723c0