On Wed, May 04, 2005 at 04:59:21PM +0200, Juerd wrote:
> > Ah yes, that's another thing I was wondering about: what does opening a
> > pipe return. If it's a one-way pipe, okay, this may be a single handle;
> > but for bidirectional opens, we need $in, $out, and $err handles; and
> 
> That'd be tridirectional, then.

Bi and up.

> A normal filehandle can already handle bidirection.

Yes, but to exploit that would be something of a perversion: the in and
out handles are very separate as far as everybody else is concerned.

> I think the following solution suffices in a clean way:
> 
>     $h = open a pipe;
>     
>     Now,
>     $h.in;
>     $h.out;
>     $h.err;
> 
>     $h.print("foo");   # use $h.out
>     $l = $h.readline;  # use $h.in

Yes, if $h is the not-very-primitive version of IO. Surely the type of
$h.in is not the same as $h itself?

-- 
Gaal Yahas <[EMAIL PROTECTED]>
http://gaal.livejournal.com/

Reply via email to