|go ahead... be a heretic|
Re: Net::Telnet and telnet command outputby Rhys (Pilgrim)
|on Oct 04, 2004 at 12:32 UTC||Need Help??|
There are three ways, all of which are documented in the perldocs for Net::Telnet. The first is to just grab the return values from the cmd method:
The second is to grab the raw input from the telnet stream (not recommended) that has already arrived:
The third is to go and grab new raw data on its way in:
The getline and getlines methods are probably much easier to deal with than get, and work on the same principles.
I highly recommend reading the perldoc info on Net::Telnet very thoroughly, even though it is rather tedious. I learn something every time I read it. I also recommend using the debugging/logging methods for a while. I have found them to be invaluable when trying to figure out why my patterns are(n't) matching some weird binary input. (The buffer_empty method is your friend.)
Hope that helps!