open() and pipes

Peter Corlett abuse at cabal.org.uk
Wed Aug 2 17:06:32 BST 2006


On 2 Aug 2006, at 16:54, Uri Guttman wrote:
[...]
> FOO is a typeglob which refers to a special structure which has a  
> single
> handle slot along with scalar, array, hash and a few other slots.  
> so it
> can't make that into 2 handles. if you use a typeglob where a  
> handle is
> expected the handle slot is used. you can make a ref to that handle  
> slot
> with the *FOO{IO} syntax but only 1 handle can be stored there (not
> counting the dir handle). so even if you could store 2 handles  
> there is
> no syntax to access both of them separately to do reading and writing.

Huh?

It doesn't need to be two handles. It just needs Perl's idea of a  
handle to be upgraded to hold up to two file descriptors. Reads go to  
one, writes go to another, and any ambiguous operation throws an  
exception.

A BSD-style socketpair(2) would be saner on platforms that support  
it, which would be pretty much everything that looks POSIX-ish, I  
suspect.




More information about the london.pm mailing list