From bd681d813b3604b6cb5085c78e4980dfecedcb8c Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 22 Oct 2010 23:36:54 +0200 Subject: Add FastCGI wrapper perl-cgi. --- perl-cgi | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 perl-cgi diff --git a/perl-cgi b/perl-cgi new file mode 100755 index 0000000..39dcc28 --- /dev/null +++ b/perl-cgi @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +# Origin: http://philpep.org/pub/perl-cgi +# Info: http://blog.philpep.org/post/Gitweb-fastcgi-lighttpd-et-FreeBSD + +use strict; +use CGI::Fast; +use Embed::Persistent; +{ + my $p = Embed::Persistent->new(); + while (new CGI::Fast) { + my $filename = $ENV{SCRIPT_FILENAME}; + my $package = $p->valid_package_name($filename); + my $mtime; + if ($p->cached($filename, $package, \$mtime)) + { + eval {$package->handler;}; + } + else + { + $p->eval_file($ENV{SCRIPT_FILENAME}); + } + } +} + -- cgit v1.2.3