Anyway, it seems to work well provided I set the handler method to call a separate Handler.pm module, which then 'uses' my main app module. As I should be able to dispense with the Handler module and put the handler directly into the main module, I used the scheme outlined in http://www.mail-archive.com/suppressed/msg00486.html.
But as I understand it, the 'sub handler ($$)' method is not available to mod_perl 2.0, and doesn't work anyway, so I substituted the mod_perl2 'sub handler : method' as follows:
sub handler : method {
my ($class, $r) = @_;
my $self = $class->new(
PARAMS => {
't0' => [gettimeofday],
# app_url changes according to whether called via mod_cgi, mp
registry or mp handler
'app_url' => 'http://127.0.0.1/hilis',
}
);
$class->run();
return Apache::OK;
}
This has no adverse effect when called via mod_cgi or MP:Registry
(presumably they ignore it), but gives the following error when called
via a Perl handler:
[error] [client 127.0.0.1] Can't use string ("HILIS4") as a HASH ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.8.7/CGI/Application.pm line 449.\n
HILIS4 is the name of my app module. Line 449 of Application.pm reads:
unless (exists($self->{__QUERY_OBJ})) {
Also getting this error:
-e: Odd number of elements in anonymous hash at
/usr/lib/perl5/site_perl/5.8.7/CGI/Application/Plugin/AnyTemplate/Base.pm
line 85.
Perhaps these errors are connected? As far as I can tell the handler : method block is correct. Any ideas? Hope this is not too confusing.
--
Richard Jones
Leeds, UK
mailto:suppressed
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.