in reply to Re: How can I control interactive cli executables on Windows from Perl
in thread How can I control interactive cli executables on Windows from Perl

Hi Marc,

I don't want to just fire off a command, I need to 'interactively' control the executable that I launch. It is not limited just to telnet, though I thought that would be a good example.

As to the why, many of these executables do not have modules and the requirements I have been given are to test the executables under certain conditions, not to write my own perl apps and test them.


"Peace, love, and Perl...well, okay, mostly just Perl!" --me

Apprentice
  • Comment on Re^2: How can I control interactive cli executables on Windows from Perl

Replies are listed 'Best First'.
Re^3: How can I control interactive cli executables on Windows from Perl
by FitTrend (Pilgrim) on Mar 30, 2005 at 15:54 UTC

    I understand. Since that is the case, here is what I recommend.

    You can use two additional methods not already talked about above. first one is the system command which will allow you to execute commands to the exe and wait for completion.

    system ("$ENV{'WINDIR'}\\system32\\telnet 10.1.1.10"); # OR ANY EXE AN +D PARAMETERS

    Otherwise, you can use the backtick to take the output of a command and place it into a variable.

    $test = `dir c:\\`; print scalar $test;

    You can dump the output of system into a variable as well. Hope this helps