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";'