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