Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a program that uses net::telnet to run some commands on another pc (linux and windows based). I use the waitfor command to run a cmd program that will test a ethernet card. I can run the test and the waitfor is capturing pass or fail. If the test fails it outputs.
C:\etest>t -eth0 link
0x103fff .eth0-link-stat -FAILED
C:\
I just wait for PASSED or FAILED and get passed or failed.
How can I capture the information up to prompt?
C:\etest>t -eth0 link 0x103fff .eth0-link-stat
You have to use @lines = $telnet->cmd(String=>$command, [Output=>$ref,] [Prompt=>$pattern,] [Timeout=>$timeout,] [Cmd_remove_mode=>$mode] @lines array will have the output of the command.