Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Probably easy, but I'm stumped - telnet question

by kschwab (Priest)
on Feb 26, 2014 at 19:17 UTC ( #1076305=note: print w/replies, xml ) Need Help??


in reply to Probably easy, but I'm stumped - telnet question

Do $datastring and/or $password maybe contain:
  • A character with ASCII value 255? That's the telnet IAC character...if you pass it to $telnet->print(), Net::Telnet will escape it with an extra IAC character. If the other end isn't actually doing the telnet protocol, it won't strip out the extra character.
  • A carriage return that is NOT followed by a newline? Net::Telnet will add a NULL char (ASCII 0) after the carriage return

In short, if the other end isn't really speaking true "telnet", it can cause this sort of thing.

You could try $telnet->telnetmode(0); ... that turns this behavior off, making it more like a plain socket.

  • Comment on Re: Probably easy, but I'm stumped - telnet question

Replies are listed 'Best First'.
Re^2: Probably easy, but I'm stumped - telnet question
by taigu (Novice) on Feb 26, 2014 at 19:57 UTC

    Interesting. I'll give telenetmode a go. But no, those scalars wouldn't have an ASCII 255 value.

    Doesn't print automatically add a newline character? What might be happening is that I'm using $telnet->get; to retrieve my responses. That wacky character shows up in my server log when I send a print command - but only following a get command. Perhaps 'get' has something to do with it?

      If the host you are connecting to runs a shell that does "fancy" stuff with the command-line prompt - such as escape strings to set color, bold, reverse-video or whatever in the "terminal" font display - you might be getting residue from thatů (but I'm whistling in the dark here).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2018-07-18 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (383 votes). Check out past polls.

    Notices?