• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

PERL CGI question

i need to call a script from another server from a script i write how can i do this??
3 Solutions
Depends on the protocol you have available.

Is it HTTP, SOAP, telnet, etc, etc......
system('/path/to/ssh user@remoteserver /path/to/script');

you also my try perl's Net::SSH module.
The way that I usually do this is to make the script on the other server web-accessible; that is, make it a Perl/CGI script on the other server.  This script should make sure that it only accepts your new script as the "HTTP_REFERER", meaning that nobody else can call your script from their web pages.

Next, in the new script that you're writing, you'll need to use the LWP module, something like this:

use strict;
use LWP::Simple;

my $html = get('');

Any value returned from the script will be stored in the $html scalar (variable).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now