in reply to Re^10: Making Perl Monks a better place for newbies (and others)
in thread Making Perl Monks a better place for newbies (and others)

I, of course, have no way of knowing if this has been changed or updated on PerlMonks to use something other than CGI.pm but the majority of older Perl programs did. Apparently the Everything Engine is no different.

I never did like CGI.pm.

I never did understand the negativity around CGI.pm. It's very easy to use and gets the job done. When projects needed to scale people would simply preload CGI.pm into memory and port their scripts to persistent mod_perl handlers. CGI was the most celebrated Perl module for many years and almost single-handedly propelled Perl to be the main programming language for building web infrastructure. Almost, because, before CGI.pm there were years of productivity enabled by something called cgi-lib.pl: https://cgi-lib.berkeley.edu/

Of course when CGI.pm came along it was encouraged and the previously popular way of getting the job done right was discouraged.

I know what is wrong with CGI.pm, and I also know what is right, but I don't understand throwing out the baby with the bathwater, when the baby was laying golden eggs (all those web frameworks sitting on CPAN, built by people who started on core CGI).

Before CGI.pm a perl web application looked like this:

print "Content-type: text/html\n\n";
After CGI.pm got all object-oriented it went like:
use CGI; my $q = CGI->new; print $q->header;
After CGI.pm fell out of favor this is a preferred method:
use Mojolicious::Lite; get '/' => sub { my $c = shift; $c->render(text => '') }; app->start;
Clearly things have gotten more abstract and less intuitive...

Replies are listed 'Best First'.
Re^12: Making Perl Monks a better place for newbies (and others)
by marto (Cardinal) on Feb 03, 2020 at 18:47 UTC

    Actually most of the examples I see posted here have use CGI; shortly followed by printing the content type and ignoring the header method. I find Mojolicious both to be intuitive, and very fun to work with.

Re^12: Making Perl Monks a better place for newbies (and others)
by Your Mother (Archbishop) on Feb 03, 2020 at 18:52 UTC

    You misspelled more secure, flexible, correct, extensible, and robust. And your CGI-fu is…

    print CGI->header; # …is just fine.

    CGI.pm/cgi-lib.pl may have given the web to Perl, for all of like five years, but it is also what took the web away from Perl. Vanilla CGI was untenable as an app deployment layer, especially in shared hosting environments, and mod_perl was too difficult and hardwired to the webserver, trebly in shared hosting environments. There is a difference between negativity and objectivity.

A reply falls below the community's threshold of quality. You may see it by logging in.