SuperSu has asked for the wisdom of the Perl Monks concerning the following question:

code :

system("telnet x.x.x.x");

Result:

Can't spawn "telnet x.x.x.x"... But the code works well under linux...

And what's more, if when I tested the system("dir");,it also works well under ActivePerl Any help?

Replies are listed 'Best First'.
Re: Error calling system(telnet x.x.x.x)
by cdarke (Prior) on Jul 15, 2010 at 11:06 UTC
    Note that telnet is not enabled by default in Windows 7 because it is insecure. You can add it from "Control Panel/Turn Windows features on or off".
Re: Error calling system(telnet x.x.x.x)
by marto (Cardinal) on Jul 15, 2010 at 10:36 UTC

    "Can't spawn "telnet x.x.x.x"... But the code works well under linux..."

    then

    ",it also works well under ActivePerl Any help?"

    Perhaps, for the sake of clarification you could explain which platform/Perl distribution cases this error? Do you have a telnet executable in your path on the system where this fails? See system regarding passing arguments. Also, consider reading How do I post a question effectively?

    Note that telnet isn't secure, though if you insist on using it try using the Net::Telnet module to ensure portability.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Error calling system(telnet x.x.x.x)
by moritz (Cardinal) on Jul 15, 2010 at 10:28 UTC
    A reply falls below the community's threshold of quality. You may see it by logging in.