in reply to Setting up mod_perl handlers

Do I have one handler that dispatches the report based on some HTTP param? Or, should I have an entry in httpd.conf for each report, ...
Whatever floats your boat. http://server/foo/bar/ maybe easier to remember for users than http://server/foo?bar or http://server/foo?op=bar the same way that http://search.cpan.org/dist/DistName/ is is easier for me to remember than http://search.cpan.org/search?mode=dist&query=DistName

Replies are listed 'Best First'.
Re: Re: Setting up mod_perl handlers
by mpeppler (Vicar) on Nov 21, 2003 at 15:30 UTC
    You can still use the path_info() information and not use the query string at all.

    F.ex. I have an archive for the Sybperl-l mailing list here. The mod_perl handler looks like this:

    <Location /archive> SetHandler perl-script PerlHandler My::Archive </Location>
    However, the "My::Archive" module understands things like: http://www.peppler.org/archive/sybperl-l/2003/11/7567.html by doing the following:
    sub handler { my $r = shift; my $path = $r->path_info(); my $q = Apache::Request->new($r); my $dbh = getDataBaseHandle(); $path =~ s/\.html$//; my ($junk, $list, $year, $mon, $msg) = split(/\//, $path); if(!$year) { displayYears($q, $dbh, $list); } elsif(!$mon) { displayMonths($q, $dbh, $list, $year); } elsif(!$msg) { displayMsgs($q, $dbh, $list, $year, $mon); } else { displayMessage($q, $dbh, $list, $year, $mon, $msg); } }
    ... and yes, the mail archive is stored in a Sybase database.

    Michael

      The programmers POV is unimportant