X-Git-Url: http://git.shiar.nl/perl/plp/.git/blobdiff_plain/eadf5be66f5ada7c6f973e0e7cf5b85985dd6e80..7a089d571590f9de96bd54840263ce5376404e66:/lib/PLP/Backend/CGI.pm diff --git a/lib/PLP/Backend/CGI.pm b/lib/PLP/Backend/CGI.pm index 5d45500..e952c5a 100644 --- a/lib/PLP/Backend/CGI.pm +++ b/lib/PLP/Backend/CGI.pm @@ -1,6 +1,7 @@ package PLP::Backend::CGI; use strict; +use warnings; our $VERSION = '1.02'; @@ -16,7 +17,7 @@ sub init { # Run backwards through PATH_TRANSLATED to find target filename, # then get file (relative) by stripping PATH_INFO. my ($path, $rel) = (delete $ENV{PATH_TRANSLATED}, delete $ENV{PATH_INFO}); - my $path_info; + my $path_info = ''; while (not -f $path) { if (not $path =~ s/(\/+[^\/]*)$//) { printf STDERR "PLP: Not found: $path$path_info ($ENV{REQUEST_URI})\n"; @@ -26,7 +27,7 @@ sub init { # move last path element onto PATH_INFO $path_info = $1 . $path_info; } - if (defined $path_info) { + if ($path_info ne '') { $rel =~ s/\Q$path_info\E$//; $ENV{PATH_INFO} = $path_info; } @@ -48,7 +49,6 @@ sub init { } delete @ENV{ - qw(SCRIPT_NAME SCRIPT_FILENAME), grep /^REDIRECT_/, keys %ENV }; @@ -94,12 +94,12 @@ Or install the C included with PLP. =head2 Lighttpd -Usually in F: -enable I (add/outcomment in server.modules), and add: +Add this to your configuration file (usually F): - cgi.assign = ( - ".plp" => "/foo/bar/plp.cgi", - ) + server.modules += ("mod_cgi") + cgi.assign += (".plp" => "/foo/bar/plp.cgi") + server.indexfiles += ("index.plp") + static-file.exclude-extensions += (".plp") =head2 Apache