Solved

PERL CGI question

Posted on 2003-10-25
5
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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…

726 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