Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Accessing reference to tied Apache::Session hash

by impossiblerobot (Deacon)
on Aug 01, 2002 at 17:27 UTC ( [id://186853]=perlquestion: print w/replies, xml ) Need Help??

impossiblerobot has asked for the wisdom of the Perl Monks concerning the following question:

I'm using Apache::Session in my application, tying a hash, then passing around a reference to that hash.

Unfortunately, I can't figure out how to access the underlying object from the reference, so that I can delete the session information.

I've tried:

$tied($session)->delete();

and:

$session->delete();

which both fail: $tied($session) returns undef (I suppose since the $session scalar isn't tied) and $session (of course) isn't an object (blessed reference), so I can't call the delete() method on it.

What is the proper way to (de)reference this?


Impossible Robot

Replies are listed 'Best First'.
Re: Accessing reference to tied Apache::Session hash
by perrin (Chancellor) on Aug 01, 2002 at 17:53 UTC
    Try this:
    tied(%{$session})->delete();

      Boy do I feel stupid! :-)


      Impossible Robot

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-09-17 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (22 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.