Hey Monks, Originally I created a script that would execute multiple commands based on a scheduled time and to execute each command I used the line:
system("start $separate_command") and die $!,$?,$^E;
Using the system function, it would open up a new cmd window when executing each command. This way I could execute more than one command simultaneously. (Previously, it was using the cmd window that I was executing the script in to run each command, but this posed a problem, because after a command was executed, if it took 30 seconds, it skipped other scheduled commands that were scheduled within 30 seconds of the first command). Anyways, I currently am messing around with the Telnet module so I can execute commands on remote hosts, and my current code for executing a command with Telnet is this:
use Net::Telnet(); $commandExecution = new Net::Telnet(Host=>$location, + Dump_Log=>"debug.txt", + Prompt=>'/C:\\\\>.*$/'); $commandExecution->login($username,$password); $commandExecution->print($separate_command); $commandExecution->waitfor('/.+$/'); $commandExecution->close;
The above code runs telnet in the window the script is running. My question: Is there a way to have it run the telnet commands above, in a separate window, like it was doing when I was using the system() function?

Hope I was clear enough.

Thanks for your assistance.


Edge118 (Perl Noob)

In reply to Using Net::Telnet Module on Windows machine by Edge118

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.