in reply to Re^2: strange character with HTTP::Request GET
in thread strange character with HTTP::Request GET
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+$//; ... }
|
|---|