Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Using select() on only one socket

by GrandFather (Sage)
on Sep 04, 2005 at 10:07 UTC ( #489036=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    print SOCKET "Hi there, client!\015\012";  # right
    print SOCKET "Hi there, client!\r\n";      # wrong
    
  2. or download this
    use Socket qw(:DEFAULT :crlf);
    print SOCKET "Hi there, client!$CRLF"      # right
    
  3. 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
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://489036]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2020-11-25 05:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?