in reply to Re: Re^6 (Third Time): mod_perl and cache?
in thread mod_perl and cache?

Hmm, Apache::Session works with a tied hash, how could I pass that without loosing the tie? (I did search through perltie, but I didn't find anything.)



My code doesn't have bugs, it just develops random features.

Flame ~ Lead Programmer: GMS (DOWN) | GMS (DOWN)

  • Comment on Re: Re: Re^6 (Third Time): mod_perl and cache?

Replies are listed 'Best First'.
Re: Re: Re: Re^6 (Third Time): mod_perl and cache?
by perrin (Chancellor) on Mar 03, 2003 at 22:30 UTC
    Just pass a reference to it.
      Hmm, I just did a little test... I'm running v5.8.0 and this yielded "Tie::IxHash" and "HASH" and "".
      use Tie::IxHash; use strict; use warnings; { my %hash; print ref(tie(%hash, "Tie::IxHash"))."\n"; $hash{'hi'} = 1; $hash{'there'} = 2; some(\%hash); } sub some{ my $temp = shift; print ref($temp)."\n"; my %hash = %{$temp}; print ref(tied(%hash)); }




      My code doesn't have bugs, it just develops random features.

      Flame ~ Lead Programmer: GMS (DOWN) | GMS (DOWN)

        The tie command does not return a reference to the hash that you tied; it returns a reference to an object of the class that you tied it to which you can throw away unless you need it to call extended methods or something. The tie mechanism is meant to be completely transparent to other code that wants to treat the tied variable like a normal variable, and is tracked internally, not through blessing/isa. To determine if a variable is tied, use the tied command.