Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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/dan_o.pl"-->
so i would like this dan_o.pl 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

Comment on execute script on remote server
Download Code
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/dan_o.pl"-->
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!

    --
    http://fruiture.de
      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 :)

        --
        http://fruiture.de

        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.

        cheers!

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/"
    simeon2000|http://holdren.net/

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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://194043]
Approved by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2014-08-21 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (136 votes), past polls