in reply to Re^2: cgi page calling another cgi when submitting form but does not returns error only to web server log and not to browser.
in thread cgi page calling another cgi when submitting form but does not returns error only to web server log and not to browser.

:) Form data comes from CGI object, you can pass this $query around ... example
sub MyModuule::DoTheCgiDance { my $query = CGI->new; ## FORMDATA my( $headers, $body ) = DoTheDance( $query ); print $headers, $body; }
Re^5: I need help with displaying newline or paragraph using perl on my website (pass arguments more subs), CGI Programming, Mojolicious::Lite +and jQuery +AJAX + Mojo::Template
  • Comment on Re^3: cgi page calling another cgi when submitting form but does not returns error only to web server log and not to browser.
  • Download Code

Replies are listed 'Best First'.
Re^4: cgi page calling another cgi when submitting form but does not returns error only to web server log and not to browser.
by Anonymous Monk on Jul 01, 2014 at 16:58 UTC
    So for commandline version you might have
    ... use MyModuule; MyModuule::DoTheCLIDance( @ARGV ); exit( 0 );

    where

    sub MyModuule::DoTheCLIDance { my %args = GetOptMyArgsIWant(\@_); my $query = CGI->new( %args ); ## FORMDATA my( $headers, $body ) = DoTheDance( $query ); print $body; ## no headers on CLI :) }

    and the other cgi

    sub MyModuule::DoTheCgiDanceOTHER { my $query = CGI->new; my( $headers, $body ) = PutOnSomePants( $query ); print $headers, $body; } sub MyModuule::DoTheCLIDanceOTHER { ## no advanced getopt stuff ## just key value key value key value my $query = CGI->new( @_ ); my( $headers, $body ) = PutOnSomePants( $query ); print $body; }

    The idea is each .cgi or .pl, uses some modules and calls calls one subroutine to take care of everything