You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by pg...@apache.org on 2006/01/10 19:09:58 UTC

svn commit: r367709 - /perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod

Author: pgollucci
Date: Tue Jan 10 10:09:56 2006
New Revision: 367709

URL: http://svn.apache.org/viewcvs?rev=367709&view=rev
Log:
add note stating that $r->pnotes() keeps a reference to the variable.

Geoffery Young points out that it was this way in mp1 was well.

Also note, Apache2::Safepnotes.

Submited By: Torsten Foersch <to...@gmx.net>


Modified:
    perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod

Modified: perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod
URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod?rev=367709&r1=367708&r2=367709&view=diff
==============================================================================
--- perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod (original)
+++ perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod Tue Jan 10 10:09:56 2006
@@ -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>



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