in reply to Using Net::Telnet Module on Windows machine

The simple mechanism would be to put your telnet code in to a small script that takes $separate_command as a command line argument.

Then the main script uses

system qq[ start perl SimpleTelnet.pl "$separate_command" ];

for each client it needs to contact.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^2: Using Net::Telnet Module on Windows machine
by Edge118 (Initiate) on Jul 08, 2004 at 15:50 UTC
    Thanks for your response. It help me out alot.
    I have one more question: How do I pass more than 1 argument into the script? I tried a few things including the following, but it didn't work:
    system qq[start perl telnetExecution.pl "$separate_command","$location +"];
    Thanks again!

      Skip the comma between the arguments, they are delimited by whitespace. You only need the "s around them if they might contain spaces or tabs.

      If the arguments could contain quotes, things start getting messy if not impossible, so avoid that if you can.

      Running this may help clarify things.

      #! perl -slw use strict; my $command = q[ perl -le"print $_ for @ARGV; print 'Enter to exit'; < +STDIN>" ]; system qq[ start $command A B C "D E" F "G H I" ];

      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon
        I used the following and it worked perfectly! Thanks for your help.
        system qq[start perl telnetExecution.pl $separate_command $location];