[OT] select and sysread problem on solaris

Nigel Hamilton nigel at turbo10.com
Thu Sep 11 11:06:40 BST 2008

Hi Paul,

> As you see, this should be covered and, in addition, I am using
> PERLIO=perlio so that Perl's own IO implementation is being used,
> allowing 1024 files to be opened per process, rather than the 256 which
> would be allowed with Solaris' stdio implementation.
Maybe you're suffering from buffering[1] between the two IO implementations.

Have you tried selecting STDOUT and flushing it? Maybe it is blocking on
some left over data? Something like: $| = 1 on the select-ed filehandle will
flush it. One other thing to check is the bytesize and character encoding of
things you are reading off the network - just to make sure there are no left
over bytes in the pipes. Also are you doing slurping reads? Make sure
nothing has messed with the end of line $/ characters.

If you are tracing what's happening sometimes your own trace writes can
bizarrely interact with IO buffers etc. I had to debug a similar problem and
when I put the trace in it blocked and when I removed the trace it worked!?
Try turning tracing off and see if it makes a difference.

A final suggestion would be to not mix IO layers. Good luck - this sounds
like a nasty one. ;-)


[1] http://perl.plover.com/FAQs/Buffering.html
[2] "Network Programming with Perl" is a brilliant book for this sort of

More information about the london.pm mailing list