?
Solved

PERL CGI question

Posted on 2003-10-25
5
Medium Priority
?
232 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
3 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 172 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 164 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 164 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses
Course of the Month17 days, 10 hours left to enroll

830 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