Solved

PERL CGI question

Posted on 2003-10-25
5
208 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now