perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adi <>
Subject Re: Small Apache::Session improvement
Date Fri, 24 Mar 2000 23:41:08 GMT
Simon Rosenthal wrote:
> b) An efficiency tweak in the STORE method for the tied hash ; we found we
> were sometimes updating the session record unnecessarily  because we were
> too lazy to  consistently write code like
>         $sesshash{'foo'}  = 'bar' unless ($sesshash('foo'} eq  'bar).
> so, since Laziness is  said to be a  virtue for Perl programmers, we
> moved  that check into the STORE method.

I like this hack, but what if the data you're storing is not scalar?  Since
Apache::Session supports multi-dimensional data structures using Manfredi's
Storable module, what would happen if you do:

	$sesshash{'foo'} = { 'bar' => 'baz' };

View raw message