perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: [Fwd: [rt.cpan.org #30061] $r->pnotes stores aliases not copies so is subject to action at a distance]
Date Tue, 06 Nov 2007 16:56:44 GMT


Geoffrey Young wrote:
> so, I've been thinking a bit about this and I think I recall the
> original reasoning way back when...
> 
>   my $obj = $class->new();
>   $r->pnotes(OBJ => $obj);
> 
> I am almost certain that this was the original use case for pnotes as I
> dig into my mind and recall the time on the list where folks were like
> "wow!  we can pass a perl scalar around the request."  what this, um,
> feature allows users to do is alter the underlying object without
> re-storing it along the way:
> 
>   $obj->update_user();
>   # next guy to pull it from pnotes gets the current state

actually, that will happen anyway I guess... it's a feature of
references that will make that work regardless of whether we copy or
alias the scalar in pnotes.

so nevermind... my brane is starting to dissolve of late...

--Geoff

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message