None of my subroutines are prototyped. They all follow the format:
sub <name>() {
<code>
}
Here are the first few lines of tester.pm and the code for the handler()
function.
----------------------------------------------------------------------
package confer::tester;
use strict;
use warnings;
use Apache2::Reload;
use vars qw($q $r $dbh $template $sql);
sub handler {
$r = shift;
$q = CGI->new();
# Instance the database connection and wrapper
# messageDie as the fuction if something fails
$dbh =
DBI->connect("DBI:mysql:database=conf;host=:/tmp/mysql.sock;",
"tester",
"testerpass",
{'RaiseError' => 1});
$dbh->{HandleError} = sub { &messageDie(
"A database error has occured.", shift, shift) };
# We will always print out HTML
$r->content_type("text/html");
# Instance the template object
$template = new HTML::Template(filename => 'background.tpl',
path => [ '/home/me/public_html/confer/' ],
die_on_bad_params => 0,
stack_debug => 0,
debug => 0);
# What are we going to do?
my $cmd = (defined($q->param("_cmd")) ?
$q->param("_cmd") :
"logintype");
if($cmd eq "logintype") {
&printLogin();
elsif($cmd eq "stats") {
&printStats();
} else {
&messageDie("How the frack did you get here?");
}
return Apache2::Const::OK;
}
Thanks,
Matthew
Philip M. Gollucci wrote:
PerlModule Apache2::Reload
PerlInitHandler Apache2::Reload
PerlSetVar ReloadAll Off
PerlRequire /home/me/public_html/confer/startup.pl
<Location /confer/tester>
SetHandler perl-script
PerlResponseHandler mypackage::tester
</Location>
Can you show some of the file's sub foo { lines ?
I've noticed Exporter doesn't always play nice if you protoype your
functions
sub foo ($@;\%) {
Also, whether or not your preload your module in startup.pl or
httpd.conf is merely a choice.
You can tweak a couple things about the way PerlModule works via
PerlOptions
http://perl.apache.org/docs/2.0/user/config/config.html#C_AutoLoad_
HTH