Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: An introduction to POE

by jeffa (Bishop)
on Aug 10, 2003 at 14:53 UTC ( #282630=note: print w/replies, xml ) Need Help??

in reply to An introduction to POE

Worked fine for me on Linux. My only recomendation would be to import CRLF() from IO::Socket
use IO::Socket qw(:crlf); local $/ = CRLF; # Cygwin, Linux, Mac, Winders, all
Or just use the CRLF() constant instead of $/ when you print. Here is a quote from Dr. Stein's Network Progamming With Perl:
When communicating with a line-oriented network server that uses CRLF to terminate lines, it won't be possible to set $/ to \r\n. Use the explicit string \015\012 instead. To make this less obscure, the Socket and IO::Socket modules ... have an option to export globals named $CRLF and CRLF() that return the correct values.
(it is very easy to get the \r\n combo backwards ;))


(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: An introduction to POE
by RMGir (Prior) on Aug 10, 2003 at 16:56 UTC
    In this case, there really is no "backwards". I really wanted a carriage return and a line feed, the order wasn't important.

    But thanks for the portability hints.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://282630]
[Corion]: Oooh - I had another devious idea - "Host C" - a C language where every struct is 4K in size. This makes memory and disk access incredibly fast ;)
[Corion]: (because everything is aligned to a memory page and all pages can be read+written directly from disk without buffering)

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2017-04-25 09:02 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (449 votes). Check out past polls.