in reply to Re^5: XML tags using perl CGI
in thread XML tags using perl CGI

you still need to use CGI if you use CGI::Carp

There is no need to use CGI if you want to use CGI::Carp. They are separate modules...

In fact
There is no need to use CGI ever!

Although I do wish there was a simple module to decode query parameters that isn't part of a framework as sometimes query parameters are needed when no framework is required.

Replies are listed 'Best First'.
Re^7: XML tags using perl CGI
by pryrt (Abbot) on Jan 14, 2024 at 17:17 UTC
    Although I do wish there was a simple module to decode query parameters that isn't part of a framework

    No need to wish, since it already exists: CGI::Simple -- it gives an interface to the CGI parameters that would be familiar to ex-users of CGI.pm without any of the hacky HTML generation cruft.

      No need to wish, since it already exists: CGI::Simple

      Oh! That's helpful thanks...

      I shall have to look into this further. Currently, I use a module I have written and used for a very long time. It exports two hashes: %data that holds the query key/value pairs. Also, %file, is a strange two-dimensional hash holding both the file data and the filename for named upload files. This was written before I understood references so it could do with changing or replacing but I've got so used to writing for this module that it's become muscle memory...

        There are a few low-fat CGI modules and one or other is probably preferable compared with CGI.pm these days. Consider CGI::Minimal, CGI::Lite and CGI::Thin in addition to the aforementioned CGI::Simple if you need that functionality without the legacy overhead. CGI::Minimal even has a nice (if outdated) performance comparison table in the Performance Hints section.


        🦛

Re^7: XML tags using perl CGI
by Anonymous Monk on Jan 14, 2024 at 11:53 UTC
    Although I do wish there was a simple module to decode query parameters that isn't part of a framework

    URI?