Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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]
[marto]: I'm all for that
[choroba]: Trainspotting without OV is just a half of the movie!
LanX just single handedly stopped Brexit!

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2018-02-19 10:51 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (262 votes). Check out past polls.