in reply to Mod_Perl2: Cannot resolve handler

#!/usr/bin/perl use strict; use Apache2::RequestRec (); use Apache2::Const qw(:common); sub handler { my $r = shift; $r->print("Content-Type: text/plain\n\n"); $r->print('TEST!'); return OK; } 1;
Where's your package directive? You're installing "main::handler".

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: Mod_Perl2: Cannot resolve handler
by cfreak (Chaplain) on Oct 30, 2005 at 16:18 UTC
      A few more things:
      • Your module doesn't need a shebang line, although I traditionally just put "#!perl" so that emacs will go into cperl mode.
      • You don't need "Options +ExecCGI" in a URL that's not using CGI-like behavior (mod_cgi or one of the *::Registry* perl doodads).
      • You don't need "PerlOptions +ParseHeaders" unless you are planning on outputting content without a header. It also slows things down a bit.

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.