I'm not sure what info is relevant here, so this may be a little verbose. I am trying to use Net::Telnet from:

perl, v5.8.0 built for sun4-solaris SunOS 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-250

to

HP-UX B.11.11 U 9000/800 (tc)

with the simple script

my $t = new Net::Telnet (Timeout => 30, Prompt => '/[:\$%#>] $/'); $t->input_log(\*STDOUT); $t->telnetmode(1); $t->open($hostip); $t->login($user, $pass);

Logon works. My problem is that after logon, the expected prompt doesn't show up in the input (which is the output of the remote server). Rather, I get a strange escape sequence like:

.^[ i^M ... ^M.^[* ... ^MTERM = (hp)

I'm supposing this is a control stream, but I can't find any reference to handling them in Net::Telnet except for telnetmode() which I explicitly turn on. (Turning it off causes logon to fail.) Prompt on the remote host is '$'.

Anyone see what I'm doing wrong, or how I can workaround the problem? TIA!

P.S. I would try Expect, but unfortunately it is not available everywhere I need to use this.

--Solo
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

In reply to Net::Telnet problem w/ escape sequences (control stream?) by Solo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.