Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Tied Variables and Subroutines

by Lexicon (Chaplain)
on Aug 06, 2003 at 20:30 UTC ( #281576=perlquestion: print w/ replies, xml ) Need Help??
Lexicon has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use Apache::Session, which returns the session as a tied hash. I'd like to impliment, for example, a Logout(%SESSION) subroutine whereby I delete (read, untie) the session. The ultimate question is do I have to retie the hash tie %SESSION, 'Apache::Session::MySQL' inside the subroutine, or is there some way to pass a reference to the object so that I can call tied(%SESSION)->destroy right off?

My impression from Programming Perl and perldoc is I'll have to retie the %SESSION every time the has is passed, which seems unpleasant in a number of ways.

Comment on Tied Variables and Subroutines
Select or Download Code
Re: Tied Variables and Subroutines
by perrin (Chancellor) on Aug 06, 2003 at 20:41 UTC
    If you are just passing around a reference to a tied hash, there is no need to retie it.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://281576]
Approved by blue_cowdawg
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2015-03-31 01:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (660 votes), past polls