system( "/usr/bin/perl /full/path/to/the/script.plx" ) #### #!/usr/bin/perl -wT $|++; use strict; use CGI qw(:standard); # important shortcuts use Fcntl qw(:flock); # imports LOCK_EX, LOCK_SH, LOCK_NB my $timestamp = localtime; # this should be as suggested above "/usr/bin/perl /path/to/Kreports.plx" my $script_to_call = "./Kreports.plx"; $TITLE = "Kim's Report Generator"; $LOGFILE = "/usr/tmp/KreportLog"; print header,start_html($TITLE),h1($TITLE); if ( param('name') ) { # if we have a name we must have been called from our form if ( ( param('name') eq 'Kim' ) and ( param('passwrd') eq 'Knecht' ) ) { &runReports(); } else { print "Unauthorized!\n"; } } else { # no name param so show form print hr, start_form; # hr() emits a horizontal rule:
print p( $timestamp ); print p( "User ID:", textfield( -NAME => "name" ) ); print p( "Passwrd:", password_field( -NAME => "passwrd")); print p( submit( "send" ), reset( "clear" ) ); print hr; print end_form; } ##### Subs ##### sub bail { my $error = "@_"; print h1("Unexpected Error"), p($error), end_html; } sub runReports { print "Generating Reports\n"; my $exit_val = system($script_to_call); if ( $exit_val ) { print "

System call failed with an exit value $exit_val\n"; print "

Let's see what a backtic exec shows us\n"; print '

', `$script_to_call`, '
'; } }