in reply to Re^3: 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.
... 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
|
|---|