- or download this
print SOCKET "Hi there, client!\015\012"; # right
print SOCKET "Hi there, client!\r\n"; # wrong
- or download this
use Socket qw(:DEFAULT :crlf);
print SOCKET "Hi there, client!$CRLF" # right
- or download this
use Socket qw(:DEFAULT :crlf);
local ($/) = LF; # not needed if $/ is already \012
...
while (<SOCKET>) {
s/$CR?$LF/\n/; # replace LF or CRLF with logical newline
}