It is not as simple as you expect. You may wish to see this node Re: Testing out a CGI script using the command line. But that still leaves you with a problem that the data section is not stripped from the whole response. Using get_response from that node and untested you might try
my $all=get_response("/full/path/to/copyorders_multiple.pl", "refID=". +&trim($license)); my ($data)=$all=~/\n\n(.*)$/s; sub get_response { my ($cgi, $CMD) = shift; ## prepare proper (CGI) environment $ENV{QUERY_STRING} = $CMD; $ENV{REQUEST_METHOD} = 'GET'; $ENV{GATEWAY_INTERFACE} = 'CGI/1.1'; # add more as needed open(CGI, "$cgi |") or die "Can't exec $cgi, $!"; local $/ = undef; my $res = <CGI>; close(CGI) or die "Error running $cgi, $!"; return $res; }
In reply to Re: replace use HTTP::Lite to run a perl file that was on another server
by huck
in thread replace use HTTP::Lite to run a perl file that was on another server
by bNathan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |