Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one build a website in Perl without CGI?

I asked a separate question about Python here, and was told that "classic CGI isn't the best way to use anything at all. With classic CGI server has to spawn a new process for every request"

Now I am working on a Perl-based website using Apache, and all my scripts start with:

use CGI;

Is this a problem? Is there a newer or better way to build a Perl-based website?

like image 833
Andrew Swift Avatar asked Dec 11 '22 02:12

Andrew Swift


1 Answers

Write your website using Plack or a framework built on top of Plack (such as Catalyst or Dancer/Dancer2).

You then have several options to deploy the website. You can deploy it as a CGI script (easy to do, but inefficient), or using FastCGI or Apache's mod_perl, or forget Apache altogether and use a standalone Perl web server such as Starman. Yet another option is uWSGI which is conceptually similar to FastCGI.

Apache's mod_proxy allows you to take a hybrid approach for deployment. Your website could be running on Apache, which could forward requests for particular URLs through to Starman.

like image 143
tobyink Avatar answered Dec 18 '22 18:12

tobyink