On Sun, 2006-08-13 at 21:04 +0200, Dalibor Straka wrote:
> Hi,
> 
> I'm writing a perl daemon with telnet interface. But here comes the
> crunch time. I need to use <CR><LF> line breaks. Is there any better
> auto-detect way than manualy switching to
>     $/ = $CRLF;
> in every telnet session? The truth is, that i(they) have a badly
> behaved php skript simulating a telnet session. It doesn't send
> crlf nor accept it. Thus send/received text is shifted.
> 
> BTW: Isn't it better to create another interface for computers?
> Easier without waiting/asking, immediately closed after the last
> output line is send.

I don't understand what you are trying to do.

If you want your perl script to send crlf all the time you could simply
be explicit  `print "\r\n";`

If you want to receive data that may or may not have crlf strip it on
input

$line = <>;
$line =~ s/[\r\n]*$//;

Ta
Ken


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to