Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: How to grab the telnet screen output?

by glide (Pilgrim)
on Jan 29, 2008 at 09:54 UTC ( #664878=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to grab the telnet screen output?
in thread How to grab the telnet screen output?

Hi,

Normally, I use the waitfor to match a temporary changed "prompt", like a --more--. And, as you can read in the Net::Telnet with

($prematch, $match) = $obj->waitfor($matchop); $obj->print(q{a}) if( $prematch =~ m{f\. Advanced}sm ); $obj->print(q{b}) if( $prematch =~ m{l\. Command Line}sm );
you can use the $prematch to get the context.

Probably, your problem it's not with the TCP packets and the Net::Telnet, but with a premature match. Use the dump_log to inspect the flow of the session, and last, but not the least, use the perl -d to check each telnet interaction.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://664878]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2018-05-23 21:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?