>Tom Christiansen wrote:
>>
>> The straightforward way to do that is quite simply:
>>
>> open(FH, "|foocmd thisfoo thatfoo|")
>>
>> or for shell avoidance:
>>
>> open(FH, "|-|", "foocmd", "thisfoo", "thatfoo"))
>Does this work now????
Not quite. Nearly, though.
>Or are you just suggesting this be added to Perl 6?
Yes. If not way before.
>Quoth Camel-3, p. 752:
>When starting a command with open, you must choose either input or
>output: "cmd|" for reading or "|cmd" for writing. You many not use open
>to start a command that pipes both in and out, as (currently) illegal
>notation, "|cmd|", might appear to indicate.
But see the tie chapter for the implementation of:
use Tie::Open2;
tie *CALC, 'Tie::Open2', "bc -l";
$sum = 2;
for (1 .. 7) {
print CALC "$sum * $sum\n";
$sum = <CALC>;
print "$_: $sum";
chomp $sum;
}
close CALC;
It doesn't even need to be so fancy. We already have two different
underlying FDs for their separte FILE*s so we can do sockets. Perl has
very close to support for this.
The multiarg pipe open is still TBD.
--tom
- Re: RFC 33 (v2) Eliminate bareword fi... Tom Christiansen
- Re: RFC 33 (v2) Eliminate bareword fi... Buddha Buck
- Re: RFC 33 (v2) Eliminate barewo... David L. Nicol
- Re: RFC 33 (v2) Eliminate barewo... Nathan Wiger
- Re: RFC 33 (v2) Eliminate barewo... Tom Christiansen
- Re: RFC 33 (v2) Eliminate barewo... Casey R. Tweten
- Re: RFC 33 (v2) Eliminate barewo... Peter Scott
- Re: RFC 33 (v2) Eliminate barewo... Gregory S Hayes
- Re: RFC 33 (v2) Eliminate barewo... Tom Christiansen
- Re: RFC 33 (v2) Eliminate barewo... Nathan Wiger
- Re: RFC 33 (v2) Eliminate barewo... Tom Christiansen
- Re: RFC 33 (v2) Eliminate barewo... Nathan Wiger
- Re: RFC 33 (v2) Eliminate bareword filehandles. Peter Scott
- ARGV vs $ARGV (was Re: RFC 33 (v2) Eliminate bare... Nathan Wiger
- Re: RFC 33 (v2) Eliminate bareword filehandles. Bart Lateur
- Re: RFC 33 (v2) Eliminate bareword filehandles. Tom Christiansen
- Re: RFC 33 (v2) Eliminate bareword filehandle... Bart Lateur
- Re: RFC 33 (v2) Eliminate bareword filehandles. Jonathan Scott Duff
- Re: RFC 33 (v2) Eliminate bareword filehandles. Piers Cawley
