Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Why CGI is hard debug

by davido (Cardinal)
on Oct 28, 2021 at 16:43 UTC ( [id://11138147]=note: print w/replies, xml ) Need Help??


in reply to Why CGI is hard debug

A COBOL application probably isn't spewing errors to the general public's web browsers. To do so can expose security vulnerabilities. So the more common approach is to spew a 500 Internal Server Error (to not expose more than is needed), and to log the error to error logs on the web host.

What gets logged is up to the person who developed the web application or CGI application. If the diagnostics aren't sufficient, add better diagnostic information to the error messages. While you're at it, make sure that you're actually handling errors usefully; that you're logging somewhere in the first place. And make sure that there are logfiles configured.

Debugging CGI is something you have to design into your CGI application. If a COBOL application were interacting over the CGI you would be facing the same concerns; this isn't a Perl-specific issue. There's nothing other than sanity preventing you creating a CGI application in COBOL. Once you do that, you'll find it equally challenging (perhaps more-so) to debug in a CGI environment. The point is that CGI layers in a whole other element of complexity, and that complexity has to be managed through more meticulous application design and architecture.


Dave

Replies are listed 'Best First'.
Re^2: Why CGI is hard debug
by Fletch (Bishop) on Oct 28, 2021 at 17:22 UTC
    There's nothing other than sanity preventing you creating a CGI application in COBOL.

    Somewhere in a strange, off-kilter dimension there's a poor shoggoth commiserating while shuffling his punch cards and saying "You know that's right" . . .

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      I just googled "COBOL CGI" and there are both open and closed source COBOL implementations providing a CGI interface, and I even find a working COBOL CGI form (with source code). I am appalled and amused at the same time.

        You can even cross-compile Cobol to JavaScript and run it in your browser as CobolScript, for whatever weird and wonderful reason you might have.

        perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11138147]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2026-01-16 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.