Solved

PERL CGI question

Posted on 2003-10-25
5
214 Views
Last Modified: 2013-12-25
i need to call a script from another server from a script i write how can i do this??
0
Comment
Question by:kuki18
5 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 43 total points
ID: 9631306
Depends on the protocol you have available.

Is it HTTP, SOAP, telnet, etc, etc......
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 41 total points
ID: 9632064
system('/path/to/ssh user@remoteserver /path/to/script');

you also my try perl's Net::SSH module.
0
 
LVL 3

Assisted Solution

by:rkosai
rkosai earned 41 total points
ID: 9828859
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('http://192.168.1.1/cgi-bin/your_script.cgi');

Any value returned from the script will be stored in the $html scalar (variable).
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question