in reply to execute script on remote server

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

Replies are listed 'Best First'.
Re: Re: execute script on remote server
by alexiskb (Acolyte) on Aug 30, 2002 at 10:22 UTC
    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
        Thanks! LWP::UserAgent works a treat! you are a star!
        #!D:/Perl/bin/perl.exe require LWP::UserAgent; my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30, ); $request = HTTP::Request->new('GET', 'http://foo.co/cgi/remote.cgi'); $response = $ua->request($request);

      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!