in reply to Re^3: replace use HTTP::Lite to run a perl file that was on another server
in thread replace use HTTP::Lite to run a perl file that was on another server

As a lark try this

my $all=get_response("copyorders_multiple.pl", "refID=".&trim($license +)); my ($data)=$all=~/\n\n(.*)$/s; sub get_response { local %ENV=%ENV; my ($cgi, $CMD) = @_; ## 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; }
and if it works, SHEESH

  • Comment on Re^4: replace use HTTP::Lite to run a perl file that was on another server
  • Download Code

Replies are listed 'Best First'.
Re^5: replace use HTTP::Lite to run a perl file that was on another server
by huck (Prior) on Feb 19, 2017 at 21:33 UTC

      it that doesnt work please answer the following
    • What happens if you go to http://newserver/newpath/copyorders_multiple.pl?refID=somevalidrefid
    • how did copyorders_multiple.pl get on/to the new server
    • Have you checked the executable settings on copyorders_multiple.pl
    • how does copyorders_multiple.pl deal with refID=".trim($license), how are you sure that any required resources or datasets needed by copyorders_multiple.pl are also on the new server?
    • Was the old server a windows machine and the new server a unix or mac machine? if so http://stackoverflow.com/questions/7858987/apache-2-throws-no-such-file-or-directory-exec-of-usr-lib-cgi-bin-fst-cgi may solve your problem.
    There are more problems that could exist, but without the error.log entries it is hard to predict