Hi Johan, * Johan Vromans <jvromans@squirrel.nl> [2013-05-26 21:25]: > Aristotle Pagaltzis <pagaltzis@gmx.de> writes: > > ... where did you get the idea to look into CGI in 2013? Not from > > any recent “web dev 101” intro. > > True, my generation grew up with CGI. As a matter of fact, > I co-authored one of the very first books on using Perl on the web in > 1995. > > So apparently your main point against CGI.pm is that the ancient > knowledge of the CGI protocol is lost? my point is actually two-fold: • CGI is not the same as CGI.pm. You don’t have to be using CGI.pm if you are doing CGI – many of us have done it with nothing in the past, or you can use something else than CGI.pm to do CGI. • CGI is not the only deployment option and indeed if you are running a web app rather than adding a guestbook or some such into a mostly static web site, then it’s certainly not the best one. But it remains *a* deployment option that can sometimes be easier than others. In both of these senses, Plack has you covered. It also has a much better factored design. It doesn’t do HTML, by itself it doesn’t even do query string parsing – but it does ship with classes that will take care of that part for you if you wish. And the APIs there all around take care to avoid repeating the mistakes that CGI.pm made. > If I'd want a trivial web app that shows me yesterday's SinFest comic, > I'd use CGI.pm and 10-20 lines of Perl code. It would work on every > web host that has Perl. What would be your approach? You can write a script using Plack that you can then deploy as a CGI – as one among any number of deployment options. I would be unsurprised to find Plack was faster than CGI.pm under those circumstances, in fact, as the latter is quite a dog really. (Performance was a major selling point for CGI::Simple back in the day… hoo boy those were the times. Party in the Perl Monks chatterbox all night long…) Have I mentioned that it’s drop dead cool to be able to wrap middlewares around your CGI script, just like that? Instead of fiddly hacking with webserver configs or trying to make ugly monkey-patch CGI.pm extensions work right when you combine them, you drop a line or two in your script, like in any other PSGI app, and presto, you’re off to the races. It’s all so, so, so much better and cleaner and saner than CGI.pm ever could be. Why would we be so cruel as to foist that relic on any newbie? By all means, keep writing CGI scripts, but do yourself a favour, let the CGI.pm bygones be bygones and join us in the future. It’s a bright day out here. Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/>Thread Previous | Thread Next