Subject: | "Use of uninitialized value in list assignment at CGI/Emulate/PSGI.pm line 21, <DATA> line 16", when using HTTP::Server::Simple::PSGI |
I am running gitweb.cgi Perl CGI script from plackup (Plack version
0.9929) via attached wrapper, using Plack::App::WrapCGI, which in turn
uses CGI::Emulate::PSGI (version 0.07).
It works correctly when running this wrapper using "plackup --app
gitweb.psgi", which in turn uses HTTP::Server::PSGI as web server.
But when I tried to use HTTP::Server::Simple::PSGI server, via "plackup
--server HTTP::Server::Simple --app gitweb.psgi", it generates the
following runtime error (when connecting to web server using "lynx
http://0:5000/"):
Use of uninitialized value in list assignment at
~/perl5/lib/perl5/CGI/Emulate/PSGI.pm line 21, <DATA> line 16.
This error is repeated three times for a single access. The page that
is served using HTTP::Server::Simple::PSGI is generated incorrectly, and
in my case it has 2152 bytes as compared to correctly generated page
when using HTTP::Server::PSGI with 5729 bytes.
Plack 0.9929
HTTP::Server::Simple::PSGI 0.14
HTTP::Server::Simple 0.42
CGI::Emulate::PSGI 0.07
CGI::Compile 0.11
perl, v5.8.6 built for i386-linux-thread-multi
Linux kernel 2.6.14-11.1.aur.2
--
Jakub Narebski
Subject: | gitweb.psgi |
#!/usr/bin/perl
# gitweb - simple web interface to track changes in git repositories
# PSGI wrapper (see http://plackperl.org)
use strict;
use warnings;
use Plack::Builder;
use Plack::App::WrapCGI;
use CGI::Emulate::PSGI 0.07; # minimum version required to work
use File::Spec;
# __DIR__ is taken from Dir::Self __DIR__ fragment
sub __DIR__ () {
File::Spec->rel2abs(join '', (File::Spec->splitpath(__FILE__))[0, 1]);
}
builder {
enable 'Debug';
Plack::App::WrapCGI->new(script => __DIR__."/gitweb.cgi")->to_app;
}