To help you on this it would be useful if you did something like
(my $hex_user=$user)=~s/(.)/sprintf("%02x",ord($1))/egs; print "User: '$user' = '$hex_user'\n";
For both $user and $password. Then we could see what is up properly. Im guessing however that is due to $/ being different from what TELNET thinks is a newline. Its quite possible that your OS thinks $/ is "\x0A" and Telnet thinks that \n is "\x0D\x0A" and since chomp only removes $/ from the end of a line it doesnt get the "\x0D". If this is so then
$user=~s/\x0D\x0A$//;
Probably would be the solution.

UPDATE: Oops, didnt notice that you were on Win32. In this case I suspect its a similar problem, but with different values, ie not "\x0D\x0A". Show use the hex output of what you've got for the user value eh..

HTH

--- demerphq
my friends call me, usually because I'm late....


In reply to Re: Extra Character from telnet by demerphq
in thread Extra Character from telnet by AcidHawk

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.