Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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)

Comment on Re: An introduction to POE
Download Code
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]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2015-11-30 09:39 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (769 votes), past polls