in reply to Re: Re: Re: mod_perl and objects
in thread mod_perl and objects

Yes, mod_perl 2.0 is still in beta. There will be some work required to port from mod_perl 1.0 to mod_perl 2.0 so switching to a syntax that works in both may save pain later.

You mentioned on the CB that the 'handler : method' syntax didn't work for you. It works for me on the stock standard Perl 5.6.1 and mod_perl 1.3.26 in Debian stable. It definitely won't work with Perl before 5.6 and may not work with earlier versions of mod_perl. I'm interested in what configuration doesn't work for you since I plan on releasing a module to CPAN that uses that syntax.

Update: Sorry, 1.3.26 is obviously my Apache version number. I'm actually running mod_perl version 1.27

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: mod_perl and objects
by geektron (Curate) on Jul 28, 2003 at 18:06 UTC
    maybe i misread the original, but in the handler module i tried:  sub handler:method just like that. and i got compile errors.

    i tried it with multiple variations of spaces. maybe you meant that it's to be in the mod_perl config, not in the handler module itself.

    and i'm using perl 5.6.1

      OK, here's a fully functional handler module that uses that syntax:

      package TestHandler; use strict; use Apache::Constants qw(:common); sub handler : method { my($class, $r) = @_; $r->content_type('text/plain'); $r->send_http_header; $r->print( qq( Class: $class Perl: $] mod_perl: $Apache::VERSION ) ); return OK; } 1;

      Here's the relevant httpd.conf entry:

      <Location /test> SetHandler perl-script PerlHandler TestHandler </Location>

      And here's the output:

      Class: TestHandler Perl: 5.006001 mod_perl: 1.27