in reply to Net::Telnet problem w/ escape sequences (control stream?)

on my HP-UX ----- B.11.11 U 9000/800 I run the above code and have no problem. I suspect your trouble may be related to the .profile of the $user. The section of my .profile that sets up the term is as follows:
# Set up the terminal: if [ "$TERM" = "" ] then eval ` tset -s -Q -m ':?hp' ` else eval ` tset -s -Q ` fi stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z" stty hupcl ixon ixoff tabs
HTH

Cheers

Sweetblood

Replies are listed 'Best First'.
Re^2: Net::Telnet problem w/ escape sequences (control stream?)
by Solo (Deacon) on Jun 16, 2004 at 19:00 UTC
    Cool suggestion! I looked in the .profile (and .login) and saw the tset and stty commands as expected.

    I dug around and found another HPUX box to test on. This one worked. Adding a print $t->cmd('uname -a'); to my snippet above gets me:

    ... login garbage ... .^[ i^M ^M.^[[ci^M ^M.^[*s1^^Qi^M ^M$ HP-UX --- B.11.00 U 9000/785 (tc)

    I see similar control sequences, but this one ends in the expected prompt, '$'.

    So I changed the prompt string to '/(?:TERM = \(hp\)|[:%\$#])\s?$/' and it's working on the first server now.

    I need to figure out why under Net::Telnet's connection, the prompt is not being set properly. From /usr/bin/telnet I see '$' on both servers.

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

      those are escape characters (bold,colors,etc) and the holdup is tset asking you to confirm the terminal type (hp)

      # probably looks like tset ?hp # remove question mark to accept hp always tset hp # choose dumber terminal type to possibly rid self of those # nasty escape sequences tset dumb tset ansi