Title: Re: MP2 - Make test Error - t/api/request_rec.t
>> sorry, I have no idea. If you reduce your code to a simple few-lines
>> script/handler and post it here, I'm sure someone will figure out what the
>> problem is, and whether it's an issue with your code or a bug in mp2.
Thanks Stas, I'll take all the help I can get... I've been trying to figure this out all day without any luck, I thought I could put to rest any problems with code once I went with a content handler and put everything in a subdirectory so I could be sure I don't have any messy global values.
 
This code has been working on a previous server with no problems, we are moving to a new server and this is the result of the same code but after a new apache and mod_perl install.
In short I can sit there and refresh the same page and over and over, sometimes I get the right page, other times I get other pages
 
Thanks in Advance!
-Chris
 
Below are the basics:
 
Index.pm:
 
package MALDEN::scripts::Index;
use Apache::Const -compile => qw(:common REDIRECT OK);
use strict;
use Mail::Sendmail;
use XML::RSS;
use POSIX qw(strftime);
use vars qw($db $r $CGI $user_name $user_role);
##########################################################################################
# Main
# Our Mod_Perl Content Handler
sub handler {
 $r = shift;
 # Define our root HTML template path
 $ENV{'HTML_TEMPLATE_ROOT'} = "/websites/MALDEN/templates";
 # Create a new global CGI object
 $CGI = new CGI();
 # Create a global DB connection
 $db = TOOLS::PublicConnectDB->connect_to_db();
 # Authenticate
 auth_incoming_user();
 # Determine what we want to do based on the request
 # Most functions will return "OK" after the "display page" subroutine
 # but for those that we have to redirect, the redirect directive and the URL will be returned
    my $back_url = "";
 my $request_type = "";
 ($request_type,$back_url) = determine_proper_action();
 
 # Properly Exit the Handler from all subs within Determine Proper Action
 if ($request_type eq 'Apache::REDIRECT') {
  $r->headers_out->set(Location => $back_url);
        return Apache::REDIRECT;
 } else {
  return Apache::OK;
 }
 
} # End of Sub
##########################################################################################
And its defined in apache as
 
<VirtualHost xxxx:80>
.....
PerlModule MALDEN::scripts::Index
<Location "/index">
        SetHandler perl-script
        PerlHandler MALDEN::scripts::Index
</Location>
.....
</VirtualHost>

Reply via email to