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

Re: An introduction to POE

by jeffa (Bishop)
on Aug 10, 2003 at 14:53 UTC ( [id://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 ;))

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(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.
    --
    Mike

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-23 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found