http://www.perlmonks.org?node_id=1004326


in reply to Calling a perl script and passing parameters from html

If the script doesn't take too long to execute and you do not need to process it's results then a wrapper script like this should be enough to get you up and running:

use strict; use CGI; use CGI; my $q = new CGI; @ARGV = (); foreach ($q->param()) { $value = $q->param($_); $value =~ s/"/\\"/g; push @ARGV, "--" . $_ . '="' . $value . '"'; } do 'path/to/the/script.pl';

All it does is it moves the parameters from the querystring or post into the @ARGV array (array of script parameters) in the format required by the script and then executes the script without starting a new process.

As long as the script prints its results to STDOUT they should be sent to the client browser.

Jenda
Enoch was right!
Enjoy the last years of Rome.