perlcgifastcgipsgi

Perl CGI vs FastCGI


I've been programming on Perl for a long time, I've always used CGI technology to build my applications. Now I think to rebuild them and write new ones on FCGI. Please, explain the difference between unsing FastCGI and PSGI with f.e. Starman. Also I'm asking to explain what Perl frameworks (which use FCGI) are "in trend" today? I understood that I can force my CGI scripts to work as FCGI scripts using CGI::Fast. Are there any other modules to do this?

Thank you!


Solution

  • You're looking at this from the wrong perspective. Don't think about how you are going to deploy the program. Instead, write your program to the PSGI interface. Then you'll be able to deploy your application in any environment - CGI, FastCGI, mod_perl, etc. without having to change anything.

    You can write "raw" PGSI using modules like Plack::Request and Plack::Response, but you'd be better advised to use a framework like Dancer or Catalyst.

    If you have existing CGI programs that you want to run in a PSGI environment, then see Plack::App::WrapCGI.