For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2006 > Re: IO::Socket->input_record_separator affects <STDIN>









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: IO::Socket->input_record_separator affects <STDIN>
DJ Stunks

2006-09-22, 9:57 pm

peter_hum@hotmail.com wrote:
> Hi,
>
> I wrote a simple socket client to talk to a device that terminates its
> replies with a hex \0x02.
>
> IO::Socket->input_record_separator( "\02" );
>
> seems to handle this but I was surprised that this affects more than
> just the socket.


You were?


IO> The following methods are not supported on a
IO> per-filehandle basis.
IO>
IO> IO::Handle->format_line_break_characters( [STR] ) $:
IO> IO::Handle->format_formfeed( [STR]) $^L
IO> IO::Handle->output_field_separator( [STR] ) $,
IO> IO::Handle->output_record_separator( [STR] ) $\
IO>
IO> IO::Handle->input_record_separator( [STR] ) $/
[color=darkred]
> Is there some way to limit the separator to the socket ?


you could try local(), but if IO::Handle doesn't play nicely with that
you will have to set the value back before you try to read from STDIN.

-jp

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com