in reply to unexpected "inner references" error from untie()

perldoc -f tied
... if( tied %session){ } untie %session;