perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject [MP2] possible pnotes bug?
Date Mon, 09 Jan 2006 18:14:08 GMT
Hi,

consider this handler:

sub handler {
  my $r=shift;

  $r->content_type('text/plain');

  my $ctx={foo=>1, bar=>2};

  $r->pnotes(x=>$ctx);

  $r->print( ">>>>>>>>>>>>>>>>\n".Dumper(
$r->pnotes('x') ) );

  undef $ctx;

  $r->print( "<<<<<<<<<<<<<<<<\n".Dumper(
$r->pnotes('x') ) ) ;

  return Apache2::Const::OK;
}

I would expect it to print 2 times the same hash. Undefining $ctx should not 
affect the value saved in pnotes. But here is what is printed:

$ curl http://localhost:8082/pnotes
>>>>>>>>>>>>>>>>
$VAR1 = {
          'bar' => 2,
          'foo' => 1
        };
<<<<<<<<<<<<<<<<
$VAR1 = undef;

If something else is assigned to $ctx instead of undefining it the pnotes 
value also reflects this.

Is that the intended behavior?


Torsten

Mime
View raw message