in reply to Re^7: Have trouble implementing a shell-alike script
in thread Have trouble implementing a shell-alike script

Ok? Just do what perlport#Newlines says
use Socket qw(:DEFAULT :crlf); local($/) = LF; # not needed if $/ is already \012 while (<SOCKET>) { s/$CR?$LF/\n/; # not sure if socket uses LF or CRLF, OK # s/\015?\012/\n/; # same thing }
Does that work for you?