perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@ectoplasm.org>
Subject Re: [MP2] possible pnotes bug?
Date Mon, 13 Mar 2006 22:55:32 GMT
Torsten Foertsch wrote:
> Geoff,
> 
> On Tuesday 10 January 2006 19:21, Geoffrey Young wrote:
> 
>>>Nevertheless, I really think it is a bug, since it provokes action at a
>>>distance.
>>
>>I think it's best filed under "feature" - the mp1 behavior is not going
>>to change and has been more than ok for years and years now, and it's
>>priobably better to have mp1 and mp2 be in sync here in the
>>principle-of-least-surprise-while-migrating kind of way than to go
>>messing around with the API now

Reviving a somewhat old thread here, so for context, here it is, archived:
http://www.gossamer-threads.com/lists/modperl/modperl/86483

Basically, I think documenting this as a feature was not such a good idea. Who
can expect that this is correct/expected behaviour

my $foo = 123;
$r->pnotes('foo' => $foo);
$foo = 456;
$r->pnotes('foo') # <== now 456

I understand _why_ this hapenning, but I think that if it's not a bug, it's certainly
a very strange behaviour, compared to, say $note{foo} = $foo; I would think that
the casual user would be bitten by something like this, even though it's documented.

Is there any good reason _not_ to make this pnotes code behave just like a hash,
and store a copy of the scalar ?

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Mime
View raw message