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
    hello!
    We have a program in visual basic 6 that runs that command "rexec", I need to explain a bit, I am trying to make a program that can execute a command in the server, lets call "attend" to the command that I need to run, "attend" is actually a program that has been there for ages, but it has a very important job, this program validates all the operation files, so to run it is quite simple in the server : "attend filename" and that it. But since we are not going to run the "attend" program in the server we need it to run on the pc's.
    I know that rexec works.

    I hope this can shed more light and you could help me thank you