dataDrone has asked for the wisdom of the Perl Monks concerning the following question:
------------error log --------------------- Can't locate Net/Rexec.pm in @INC (@INC contains: blah blah BEGIN failed--compilation aborted at /usr/local/apache/cgi-bin/cgitest2.pl line 3. Fri Aug 17 18:41:06 2001 (Error) Premature end of script headers: ------ End log -----------------And yes, i know i should filter the arglist before allowing it to be passed as cmd line args
------------ Code here --------------
#!/usr/bin/perl
use CGI qw(:standard);
use Net::Rexec 'rexec';
$|=1;
foreach $i (1..5) {
my $varname=uc param("var$i");
push @arglist, $varname;
}
$rsys = "myotherbox";
$rcmd = "/pathto/my/program @arglist";
$ruser = "username";
$rpass = "password";
($rc, @rcmdOutput) = rexec($rsys, $rcmd, $ruser, $rpass );
print @rcmdOutput;
---------------- eoc -----------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: rexec from a cgi vs cmdline
by tachyon (Chancellor) on Aug 18, 2001 at 10:16 UTC | |
|
Problem Solved
by dataDrone (Acolyte) on Aug 18, 2001 at 20:29 UTC | |
|
Re: rexec from a cgi vs cmdline
by dataDrone (Acolyte) on Aug 18, 2001 at 04:58 UTC | |
by Trimbach (Curate) on Aug 18, 2001 at 05:48 UTC | |
by dataDrone (Acolyte) on Aug 18, 2001 at 18:03 UTC | |
by perrin (Chancellor) on Aug 18, 2001 at 08:34 UTC |