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

The client in my question is not a robot/program,

but a human using telnet.

  • Comment on Re^7: Have trouble implementing a shell-alike script

Replies are listed 'Best First'.
Re^8: Have trouble implementing a shell-alike script
by Anonymous Monk on Sep 14, 2011 at 12:55 UTC
    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?