Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl: the Markov chain saw
 
PerlMonks  

Re: An introduction to POE

by jeffa (Chancellor)
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 ;))

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)


Comment on Re: An introduction to POE
Download Code
Re: Re: An introduction to POE
by RMGir (Parson) 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
Node Status?
node history
Node Type: note [id://282630]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2014-04-21 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (494 votes), past polls