http://www.perlmonks.org?node_id=11132949


in reply to CGI.pm not good practice, so what is good, modern, practice for reading CGI paramters?

See also:

  • Comment on Re: CGI.pm not good practice, so what is good, modern, practice for reading CGI paramters? (updated)

Replies are listed 'Best First'.
Re^2: CGI.pm not good practice, so what is good, modern, practice for reading CGI paramters?
by leszekdubiel (Scribe) on May 24, 2021 at 09:35 UTC

    Thank you. CGI::Simple -- this is what I was looking for. :)

      Nope. Substituting CGI::Simple in place of CGI is missing the point.

        I rather think it is the point. The poor OP just wants Perl to let him use the Common Gateway Interface method for getting URL parameters into a Perl script, and he's run into the fact that CGI.pm is no longer in core, so CGI isn't as easy as it could be. Now he'll need to learn how to install modules.

        We've made it difficult for anybody to use the Common Gateway Interface by removing CGI.pm from core and then expecting the person to wade through all of our we-know-better information about the PSGI protocol, available frameworks, why a template system is needed, why CGI.pm's HTML generating functions are evil, why it's better to have a persistent web server as compared to the Apache he's probably running now, etc.

        All such information is useful and true, of course, but it's unnecessary to know for someone who wants the minimum viable solution of a Common Gateway Interface.

        I suspect that CGI.pm and the Common Gateway Interface are shunned largely because the Perl community is anxious to be sure that every newcomer learns -- perhaps the hard way -- that Perl for the web and CGI are no longer synonymous. But one casualty is the situation encountered by the OP, which I would guess is much more common than we'd like to admit.

Re^2: CGI.pm not good practice, so what is good, modern, practice for reading CGI paramters?
by Anonymous Monk on May 28, 2021 at 01:10 UTC