thanks. :)

I've ploughed through the manual and I'm pretty sure I've been trying
both notes and pnotes correctly. There's also a fairly common mistake of
assuming you're dealing with the initial request, when in fact
Apache->request is a sub-request and you need to use $r->main to
retrieve the main request to access your pnotes. I'm not making that
mistake either. 

The last option you mention about mod_perl compilation options: I've
compiled with EVERYTHING=1 and I even grep'd the apache and mod_perl
source just now for 'pnotes' to see if I could spot anything. Nothing
popped out at me. 

I'll try to recompile with
PLUS_THAT_OTHER_LITTLE_THING_NOT_INCLUDED_IN_EVERYTHING=1 now and see if
I have better luck ;)

On Wed, 2003-07-16 at 22:58, Dennis Stout wrote:
> > I'm trying to store data about a user who has authenticated in
> > $r->pnotes so that a perl logging phase handler can stick the user_id in
> > the db. I call $r->pnotes('keyname' => 'somevalue'); in an apache
> > registry script, and then call $r->pnotes('keyname') in the logging
> > handler later on during the logging phase, but am getting nothing back.
> > No errors, just undef. I've tried notes too, and no luck their either.
> > I'm using Apache::Request btw. I've also tried retreiving a tied hash
> > using $r->pnotes() and there are no key/values in that either.
> 
> the mod_perl API book specifically said pnotes is the way to communicate
> between handlers.  As I have hte PDF version, I can't exactly cut & paste it
> easily...
> 
> pnotes gets cleared after every request, so good thinking on trying notes, as
> it apearently doesn't.
> 
> the basic usage is this:
> 
> $r->pnotes("MY_HANDLER" => [qw(one two)]);
> my $val = $r->pnotes("MY_HANDLER");
> print $val->[0]; # prints "one"
> 
> So basically, $r->pnotes("MY_HANDLER" => [qw(one two)]); will create a hash
> where MY_HANDLER is a key to an anonymous array.
> 
> my $val = $r->pnotes("MY_HANDLER"); sets $val to be the reference to that
> array.
> 
> print $val->[0]; dereferences the first spot in the array reference.  The
> dereferencing thing is key here.  $val[0] will throw errors about globals not
> being declared as arrays or something of that sort.
> 
> 
> > Did I forget to compile apache or mod_perl with an option of some sort?
> > I can't think of any other explanation. I compiled mod_perl with
> > EVERYTHING=1
> 
> There is the problem right there.  It needs to be compiled with "EVERYTHING=1
> PLUS_THAT_OTHER_LITTLE_THING_NOT_INCLUDED_IN_EVERYTHING=1".
> 
> :P
> 
> Dennis
-- 
Mark Maunder <[EMAIL PROTECTED]>
ZipTree Inc.

Reply via email to