http://qs1969.pair.com?node_id=11132954


in reply to Re^2: CGI.pm not good practice, so what is good, modern, practice for reading CGI paramters?
in thread CGI.pm not good practice, so what is good, modern, practice for reading CGI paramters?

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

Replies are listed 'Best First'.
Re^4: CGI.pm not good practice, so what is good, modern, practice for reading CGI paramters?
by davebaker (Pilgrim) on May 24, 2021 at 19:26 UTC

    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.

      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. In reply to Re^4: CGI.pm not good practice, so what is good, modern, practice for reading CGI paramters? by davebaker

      Hi. The OP read new CGI.pm docs which warn about best modern practices

      but didn't follow link and didn't read CGI::Alternatives.

      This is what op is missing. Please read CGI::Alternatives.

      CGI::Simple is just a old stripped down version CGI.pm. its also not in core. Both modules are on cpan.

      switching from CGI.pm to use CGI::Simple is missing the point of the warning, neither is modern practice for web apps.