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

As far as I know, you still need to use CGI if you use CGI::Carp - especially if you also want to pass paremters to the CGI module.

As for how to combine the import parameters (that is, the list of arguments to "use CGI") you can just lump them all together:

use CGI qw(:standard :html2 -no_xhtml);
Note that you really should not use html2 - HTML 2 is very outdated. Just using the -no_xhtml option should be enough.

Replies are listed 'Best First'.
Re^6: XML tags using perl CGI
by Bod (Parson) on Jan 14, 2024 at 00:34 UTC
    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.

      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...

      Although I do wish there was a simple module to decode query parameters that isn't part of a framework

      URI?