Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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?


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?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2018-08-18 17:53 GMT
Find Nodes?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:

    Results (185 votes). Check out past polls.