in reply to Re: strange character with HTTP::Request GET
in thread strange character with HTTP::Request GET

Thanks for the suggestion! I did a hex dump and found "0D 0D 0A" at the end of each line or like you said, "CR CR LF". I am not 100% sure how to do it off the top of my head, but I guess I can drop these extra characters.
  • Comment on Re^2: strange character with HTTP::Request GET

Replies are listed 'Best First'.
Re^3: strange character with HTTP::Request GET
by ikegami (Patriarch) on May 01, 2008 at 05:34 UTC

    It's probably only CR LF. The LF was converted to CR LF by Perl since you didn't binmode(STDOUT).

    You could do:

    while (<$fh>) { s/\x0D\x0A\z//; ... }

    Or change $/:

    local $/ = "\x0D\x0A"; while (<$fh>) { chomp; ... }

    Or if you don't care about whitespace at the end of the line, the following works with CR CR LF and CR LF:

    while (<$fh>) { s/\s+$//; ... }