forked from szabgab/perlmaven.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperl-cgi-mod-perl-psgi.tt
More file actions
53 lines (36 loc) · 2.09 KB
/
perl-cgi-mod-perl-psgi.tt
File metadata and controls
53 lines (36 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
=title Which is better perl-CGI, mod_perl or PSGI?
=timestamp 2013-02-18T22:45:56
=indexes CGI, mod_perl, FastCGI, PSGI, Plack
=status show
=author szabgab
=index 1
=archive 1
=feed 1
=comments 1
=social 1
=abstract start
I just saw a question asking <b>Which is the best way? perl-cgi or mod-perl?</b>. My quick answer would be neither.
Use a PSGI capable web framework and then deploy as you want.
=abstract end
<h2>Perl CGI</h2>
A long, long time ago a galaxy far far away, we used CGI (aka. Common Gateway Interface) to create web applications.
It was good as it solved the problems back in the '90s but it was also slow.
People wanted faster solution so there came <b>mod_perl</b> which is a module in the Apache web server.
It is capable of fantastic things, but most people used it a turbo-engine for CGI applications.
It could indeed boost the speed of a web site by 100, 200 times. Compared to the plain CGI solution.
There were other solutions to the slowness of CGI. For example <b>FastCGI</b>.
All that was good and solved the problems of the early years of the 21st century, but it was hard to move
from one of these systems to another. Then came the modern era.
<h2>PSGI and Plack</h2>
<a href="http://bulknews.typepad.com/">Tatsuhiko Miyagawa</a> created <a href="http://plackperl.org/">PSGI and
Plack</a>. That allows developers to write their code once and deploy in many ways including CGI, mod_perl, FastCGI,
nginx and Starman. Just to name a few.
That somewhat frees the software developer from hard-coding deployment-related code.
<h2>Frameworks</h2>
Of course almost no one writes plain Plack/PSGI code. Almost everyone uses one of the web application development
frameworks of Perl.
For lighter application people usually use either <a href="http://perldancer.org/">Perl Dancer</a>
or <a href="http://mojolicio.us/">Mojolicious</a>.
For bigger applications people use <a href="http://www.catalystframework.org/">Catalyst</a>.
Now I "only" need to write my tutorials for all these frameworks ...
(This post was partially based on the reponse of <a href="http://perlhacks.com/">Dave Cross</a>. Thanks!)