in reply to submitting a form from within a script
#!/usr/bin/perl -Tw
use CGI qw( :header :param );
use LWP::Simple;
use strict;
my %pairs = ();
my $remote_script = "http://localhost/cgi-bin/demo.pl";
for my $p ( qw( foo bar ) ) { # assume 'foo' and 'bar' are the params
$pairs{$p} = param($p);
}
# there's more than one way to do this . . .
my @params = map { $_ = $_ . '=' . $pairs{$_} } keys %pairs;
my $url = $remote_script . '?' . join '&', @params;
print header;
print "GET'ing $url<p>\n";
print get($url);
|
|---|