Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to set End of record in socket stream?

0 views
Skip to first unread message

peter_hum

unread,
Oct 28, 2005, 2:55:31 PM10/28/05
to
Hi Group,

I have a simple perl server (on Linux) & I am trying to emulate a
device that expects <etx> HEX 3 as the record separator. The default
separator is newline. How do I change this to HEX 3 ?

I am using:

--------------------------------------------------------
$local = IO::Socket::INET->new(
Proto => 'tcp', # protocol
LocalAddr => 'localhost:1234',
Reuse => 1 ) or die "$!";

$local->listen(); # listen
$local->autoflush(1); # To send response immediately

my $addr; # Client handle

while ($addr = $local->accept() )
{ # receive a request

while (<$addr>)
{ # Read messages from client
------------------------
Thanks, Peter.

Joe Smith

unread,
Oct 30, 2005, 5:45:26 AM10/30/05
to
peter_hum wrote:
> ... the record separator. The default
> separator is newline. How do I change this...

perldoc perlvar

That document lists perl's special variables, including
the INPUT_RECORD_SEPARATOR and OUTPUT_RECORD_SEPARATOR

0 new messages