in reply to Connecting to a remote host
If script 2 can be a CGI just send it the values by calling it with the appropriate query string:
# in script 1 use LWP::Simple; my %values = ( foo => 'some val', bar => 'other val' ); my $script2 = 'http://somewhere.com/cgi-bin/script2.pl'; my $query_string = join '&', map { '$_=' . escapeURL($values{$_}) } ke +ys %values; my $res = get( $script2 . '?' . $query_string ); print $res; sub escapeURL { my $encode = shift; return undef unless defined $encode; $encode=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg; return $encode; } # in script 2 use CGI; my $q = new CGI; print $q->header; # prove we got it.... print "<p>Got: $_ " . $q->param($_) for $q->param(); # print stuff to file....
Alternatively use Net::SSH or IO::Socket or shell out to system('ssh', 'user@machine', 'script', 'data' ). There are lotsa ways to do it.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Connecting to a remote host
by rupesh (Hermit) on Apr 04, 2003 at 11:53 UTC | |
by tachyon (Chancellor) on Apr 07, 2003 at 04:31 UTC | |
by rupesh (Hermit) on Apr 07, 2003 at 11:15 UTC | |
by tachyon (Chancellor) on Apr 07, 2003 at 23:47 UTC |