Oh wise monks, stop the voices in my head, I beg of you.
My problem :
Establish a telnet connection to a device's alarming port. Change
the mode of the alarming connection from 'GUI' to clear text (i.e. no control
characters creating garbage in the data stream). This is done by pressing F-11 in a simple telnet session.
According to xev, F-11 = "\0xffc8". Now, how does one pass this via perl using Net::Telnet?
Solution (or beginnings thereof):
sub openport{
my ($name,$ip,$port)= @_ ;
print "Connecting to $name @ $ip:$port " if $debug > 1;
my $nameport = $name.$port;
$$nameport = new Net::Telnet (Timeout => 120);
$$nameport->errmode("return");
$$nameport->open(Host => $ip,
Port => $port);
if (($error = $$nameport->errmsg) ne ""){
return $error;
} else {
return "OK";
# Now we send F-11 change the session to clear text.
$$nameport->cmd("[Here's the problem]");
}
}
$$nameport->cmd needs to emmulate the F-11 keystroke. Any input would be greatly appreciated.
Thank you.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.