Hello,
Below is a little test script, that show a strange behav. ( or may be a bug ).
============================================================
#!/usr/bin/perl
use strict;
use warnings;
if ( fork ) {
    wait;
}

# this will not work on Apache 2.2 on Windows
# gives following error into "child" thread
# "No callback found for callback key 'Download|Process_cb'"
# use App::Mason::Interp qw();
# ... but this will work
eval 'use App::Mason::Interp qw();';
my $InterpObject = App::Mason::Interp->new
    (
        comp_root => '/var/www/site',
        cb_classes   => 'ALL',
        ignore_nulls => 1,
    )
;
$InterpObject->exec( '/index.mhtml', 'Download|Process_cb' => 1 );
1;
__END__
package App::Mason::Interp;
use strict;
use warnings;
# Load order is important here!
use App::Callback qw();
use App::Callback::Download qw();
use MasonX::Interp::WithCallbacks qw();
use base qw(MasonX::Interp::WithCallbacks);
1;
__END__
package App::Callback::Download;
use strict;
use warnings;
use Params::Callback qw();
use base qw(Params::Callback);
__PACKAGE__->register_subclass;
use constant CLASS_KEY => 'Download';
sub Process : Callback
{
    my $self = shift;
    return;
}
1;
__END__
============================================================
The problem actually happens into Params::Callback package, because on load 
time it "search" all defined callback methods,
and stores into package variable all code references that are declared as 
callbacks. But these code references are different into the child process,
( which I have no idea why is this, may be a behav. from Attribute::Handlers 
package ) and into these case the above error occurs.
The solution in this case, is _not_ to load anything into your parent process 
before the child process is created ( oposite from Unix case, when
this is crutial for memory sharing ), i.e. without custom start.pl script into 
apache conf or custom loading of perl packages into httpd.conf.
Regards,
Andrei




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to