hi again...
I'm having lots of problems with the get_handlers method... the following is
reproducible for me under 1.22, 1.23 and the latest cvs using 1.3.12...
-------------------
#!/usr/bin/perl
my $r = shift;
my $list;
my @array = qw('test' 'array');
$r->pnotes(TEST => \@array);
$r->push_handlers(PerlLogHandler => sub {
my $pnotes = $r->pnotes;
foreach my $key (sort keys %$pnotes) {
warn "this is the key $key";
};
});
#$list = $r->get_handlers('PerlLogHandler');
$r->send_http_header('text/plain');
foreach my $key (@$list) {
print "$key\n";
}
print "done!";
-------------------
running as is prints the pnotes keys.
uncommenting the get_handlers method gives:
Attempt to free unreferenced scalar.
and no other output, yet a code reference is visible in the browser...
The other thing is that this only seems to be an issue for code references -
if I push My::Logger instead of a subroutine, all is fine...
Am I using push_handlers incorrectly, or is get_handlers mucked up (or can
nobody reproduce this)?
--Geoff
>On Tue, 25 Apr 2000, Geoffrey Young wrote:
>> Hi all...
>>
>> I've noticed that get_handlers() will return the enabled handlers
>> for a PerlPostReadRequestHandler, but not when it is specified as a
>> PerlInitHandler (either by calling
>> $r->get_handlers('PerlPostReadRequestHandler') or
>> $r->get_handlers('PerlInitHandler'). It is the same with
>> PerlHeaderParserHandler. An oversight?
>>
>> Also, I can't get anything for PerlCleanupHandlers, which kinda
>> makes sense, since Cleanup isn't really a phase, per se (at least
according
>> to the book). Does it make sense to add this to get_handlers() as well?
>
>oversight. neither CleanupHandler nor InitHandlers is in the
>handler_table in Apache.xs. probably because those directives were added
>after get/set handlers was implemented, and the table was never updated.
>i'll see about fixing that.
>