On Monday 09 January 2006 21:11, Philip M. Gollucci wrote: > Feel free to submit a documentation patch that would alleviate > confusion.
How about that? Torsten
--- mod_perl-2.0.2/docs/api/Apache2/RequestUtil.pod~ 2005-10-21 02:05:00.000000000 +0200 +++ mod_perl-2.0.2/docs/api/Apache2/RequestUtil.pod 2006-01-10 10:53:47.995798724 +0100 @@ -714,6 +714,19 @@ $val = $r->pnotes($key); $hash_ref = $r->pnotes(); +B<Note:> sharing variables really means it. The variable is not copied. +Only its reference count is incremented. If it is changed after being +put in pnotes that change also affects the stored value. The following +example illustrates the effect: + + my $v=1; my $v=1; + $r->pnotes( 'v'=>$v ); $r->pnotes->{v}=$v; + $v++; $v++; + my $x=$r->pnotes('v'); my $x=$r->pnotes->{v}; + +In both cases C<$x> is C<2> not C<1>. See also C<Apache2::SafePnotes> on +CPAN. + =over 4 =item obj: C<$r>
pgpgiUmQUsqdS.pgp
Description: PGP signature