in reply to Re^4: searching for small Cookies example but found does not work
in thread searching for small Cookies example but found does not work

Molicious: Contraction of moustache and delicious. Generally sarcastic, and particularly applies to porno moustaches and their wearer.

One's tongue can't make that big a slip with the word "CGI(.pm)"! or can it?

I have never written anything with Mojolicious, that's why I did not cite. My first and mainly negative impression with that (from their hello world app, which is the very first thing you see on their website) was that one had to deploy a Mojo-supplied webserver. That always makes me run away, am I wrong in that impression?

Replies are listed 'Best First'.
Re^6: searching for small Cookies example but found does not work
by marto (Cardinal) on Jul 31, 2018 at 12:41 UTC

    The example on the first page shows :

    "To run this example with the built-in development web server just put the code into a file and start it with morbo."

    For more details see Deployment. documentation/Tutorial are worth reading. For all of the reasons quoted above, recommending CGI to someone who looks like they're just getting started seems like a bad idea to me (and apparently the people who maintain CGI).

      I don't want to get tangled in the politics of whether CGI is safe to use or is advisable to use or is advisable to start a project with, but my impression from at least here Review of CGI::Alternatives and here UP-TO-DATE Comparison of CGI Alternatives is that there is still a lot of dust in the air and the most important criterion which is safety ticks OK.

      Personally, I like my perl scripts to be as simple as possible, look like perl code and smell like perl code (ok i have to admit C influences). If I want to use a template I find the best module for my purpose and use it. I do not use CGI because of its html-producing capabilities neither I do not use CGI because it has no template processing capabilities.

      Against CGI is this from https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Apache-mod_proxy:

      Apache/CGI
      
      CGI is supported out of the box and your Mojolicious application will automatically detect that it is executed as a CGI script. Its use in production environments is discouraged though, because as a result of how CGI works, it is very slow and many web servers are making it exceptionally hard to configure properly. Additionally, many real-time web features, such as WebSockets, are not available.
      

      I find this kind of arguments much more convincing than "even the people who maintain CGI recommend against it". If they do then they should delegate maintenance to someone else or shut the project down if it is indeed some expired and menace-to-the-unsuspected-public technology.

      So, with my amateur-web-design background and the 30% knowledge of Perl that I have, I will still provide examples using CGI without claiming that this is the best or the only way to do it. I will make a mental note from now on to mention the weird fact that the maintainers of CGI dicourage its use and promote something else instead without strong arguments (as one would expect in this case) such as safety, performance+efficiency, code re-use, code maintanability. And I will also mention that with maintainers like them, CGI will very soon become obsolete (maybe already is wrt websockets) and die from an act of patroctony.

        "Against CGI is this"

        There is a difference between a Common_Gateway_Interface program and something which is dependent upon CGI. Further info: Mojo::Server::CGI.

        "If they do then they should delegate maintenance to someone else or shut the project down if it is indeed some expired and menace-to-the-unsuspected-public technology."

        I prefer what seems to be a maintenance only stance which they've taken. Why would you want to kill something off for no good reason when vast amounts of existing code depends on it?