Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

execute script on remote server

by alexiskb (Acolyte)
on Aug 30, 2002 at 10:06 UTC ( #194043=perlquestion: print w/replies, xml ) Need Help??
alexiskb has asked for the wisdom of the Perl Monks concerning the following question:

Wise Brethren, I wish to call a script on another machine from my script. my original script is called from an SSI as below:
<!--#exec cgi="scripts/"-->
so i would like this script to run a script on antoher UNIX box with sendmail ( the server with orginal script im so sad to say is running, IIS ( yuk!) ... how do i call the script inside my code so nothing appears on webpage ie not messing with redirects etc.. and without the use of modules... thank you kindly

Replies are listed 'Best First'.
Re: execute script on remote server
by fruiture (Curate) on Aug 30, 2002 at 10:11 UTC
    and without the use of modules

    nope. First of all: How do you want to make the remote script run? Via HTTP-Request, or via SSH or Telnet? And secondly: each of these will require _a lot of code and knowledge_ to be done without external module. Why no module? This is Perl!

      hmm.... i would love to use modules, but sys admin is tricky, which module would you suggest? http-request is my route... all my remote script does is fire off an email via sendmail to say the first script has been run... if this can all be done without sending content to the browser, thanks fruiture!

        Then you need LWP(libwww-perl) (LWP::UserAgent and dependencies, LWP::Simple is usefull). On a good server with Perl, LWP should be installed anyway, a good sys admin will realize that :)


        As others have said, for your specific case, I would bypass the whole remote thing and have the original script send the email.

        If that's not possible, or for other situations, I sometimes use an image link that points to a second/remote script, which does whatever it needs to do and just returns a single pixel image to the browser.*

        * This technique is often referred to as a 'web bug', and though it has a bad rap for inappropriate and malicious use by banner advertisers and spammers, the technique itself is often perfect for legitimate purposes as well.


Re: execute script on remote server
by simeon2000 (Monk) on Aug 30, 2002 at 13:08 UTC
    Friend, if all your remote script does is fire off an email, I'm curious as to why you don't just have the local script fire off said email? There are many ways on any OS to send email through perl. I think you might be getting the cart before the horse... unless there's some specific reason you can't send an email from the local box.

    perl -e "print qq/just another perl hacker who doesn't grok japh\n/"

Re: execute script on remote server
by rbc (Curate) on Aug 30, 2002 at 18:40 UTC
    Maybe SOAP::Lite should be something you should look into?
Re: execute script on remote server
by alexiskb (Acolyte) on Aug 30, 2002 at 10:11 UTC
    sorry didnt comment code.. jus t a standard SSI
    <!--#exec cgi="scripts/aleXis/"-->

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://194043]
Approved by grinder
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2018-03-21 17:30 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (270 votes). Check out past polls.