CGI::Application under FastCGI

Oddness exhumed.

Just a quick note – perl’s CGI::Application::FastCGI , as of version 0.2, has a fatal bug that keeps it all but unusable – it doesn’t create a new CGI::Application object on each run, and objects get “stuck” in memory. It’s totally b0rked.

I don’t like the idea of changing my modules to use a different subclass for each persistent environment anyway, especially when the solution is as simple as a couple extra lines of code in your instance script. Below is an example instance script that works fine under FastCGI, and doesn’t require you to change your CGI::Application modules.

#!/usr/bin/perl
use strict;
use warnings;
use CGI::Fast;
use lib '/home/username/lib';
use ModuleName::Main;
my ($q,$app);
while($q=new CGI::Fast){
        $app=ModuleName::Main->new(QUERY=>$q);
        $app->run();
}
Recommend me on Working With Rails

Add to Technorati Favorites

Add to Google