in reply to Re: Need help getting output from Telnet into a string or array
in thread Need help getting output from Telnet into a string or array
Thanks for your post. I guess I missed that tidbit of info. I can see it pass the 1 when I query the string. I modified my call line to the following
@array=$telnet->cmd(string => 'ls', prompt => '/=>/');
to explain the prompt tag, I found the following tidbit of info
To run a program and gather its output, use the cmd method. Pass it the string to send; it returns the command output as one line per list element in list context, or as one long line in scalar context. It waits for the Prompt before returning.
my array is still coming back empty, I'm guessing I'm not passing the information via a list context, so how would I go about doing it? Thanks again for all your help!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Need help getting output from Telnet into a string or array
by jhourcle (Prior) on Mar 15, 2012 at 21:43 UTC | |
by TravisC (Novice) on Mar 16, 2012 at 15:28 UTC | |
Re^3: Need help getting output from Telnet into a string or array
by samtregar (Abbot) on Mar 15, 2012 at 19:11 UTC | |
by TravisC (Novice) on Mar 15, 2012 at 19:23 UTC | |
by TravisC (Novice) on Mar 15, 2012 at 21:49 UTC |