Geoffrey Young wrote:

+1, but could also do:

sub cleanup {
    my ($r, $what) = @{+shift};
    $r->notes->add(cleanup => $what);
    1;
}
...
$p->cleanup_register(   \&cleanup, [$r, 'parent']);
$subp->cleanup_register(\&cleanup, [$r, 'child']);


the idea was that one calls set and one calls add - although table order is guaranteed, so it shouldn't be an issue, if the parent pool is destroyed before the child then only one appears in notes (as opposed to them being in a different order).

and hence the test will fail. but yours is just fine.


also to make things foolproof you probably want to do:

($notes[0]||'') eq $whatever

otherwise it may die on undefined...

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to