[cgiapp] Routesplugin with mod_perl Issue

Mike Tonks fluffymike at googlemail.com
Fri Sep 9 06:25:42 EDT 2011


I've been running the following hack for a while.  I added it when we
first tried running under mod_perl, and it slipped into production and
got forgotten about.  Taking it out causes the application to fail to
assign run modes correctly when running under mod_perl.

In CGI::Application:Plugin::Routes
sub routes_parse {
	#all this routine, except a few own modifications was borrowed from
the wonderful
	# Michael Peter's CGI::Application::Dispatch module that can be found here:
	# http://search.cpan.org/~wonko/CGI-Application-Dispatch/
	my ($self) = @_;
	my $path = $self->query->path_info;
	
	# Mike mod_perl hack
	if (!$path) {
		$path = $ENV{SCRIPT_NAME};
		$path =~ s/^\/[\w\.]+//;
	}


seems like a very simple issue - for some reason path_info is not
defined under mod_perl?

I get the same behaviour with CGI::Application 4.50 and 4.31

I'd really prefer to remove this awful hack from my code - can anyone advise?

thanks,

mike


More information about the cgiapp mailing list