blob: 39dcc28d1ed11bae7289a38fdc75767c16a88155 (
plain)
- #!/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});
- }
- }
- }
|