in reply to Problem with Net::rexec
First, I'd question whether the remote host provides the rexec service. As far as I know, that's not supported very much anymore and has been mostly replaced with ssh (see Net::SSH). So, check whether this works from the command line before proceeding in Perl.
Second, I'm pretty sure that "[userid, [password]]" in the documentation means that those arguments are optional. Your code should actually say:
($rc, @output) = rexec($addr, $command, $userid, $password );
As an aside, I'd guess that the contents of @output has newlines already, so you can print it this way:
print @output;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with Net::rexec
by padawan_linuxero (Scribe) on Apr 08, 2008 at 20:03 UTC |