----- Original Message ----- 
From: "Harry Putnam" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 28, 2003 7:18 PM
Subject: Re: make CPAN::Shell->i; print to a filehandle


> Mark G <[EMAIL PROTECTED]> writes:
> 
> 
> >> $target = "somefile";
> >> if($opt_r){
> >>   open(FH,">$target") or die "Cannot open $target: $!";  
> >>     print FH CPAN::Shell->i;  
> > you can try IPC::Open2.
> 
> That looks like the stuff.  Apparently the pod author felt it was
> criminal to supply even a very basic example.   Thereby creating a
> situation where anyone not already a programmer must stumble around
> endlessly trying to figure out the syntax to get some use of it.

This is posix stuff mostly

> 
> I really do appreciate those few outlaws who put usefull examples in
> the documentation.

why not if u got time

> 
> Its not clear to me what to do after this:
> $pid = open2($wtr, $rdr, 'CPAN::Shell->i');
> 
> while(<WHAT GOES HERE>){
>   print AND_HERE "$_\n";
> }

that would be

$pid = open2($wtr, $rdr, 'CPAN::Shell->i');

foreach( @module ){
    print $wtr "$_\n";
    print "shell output: $_\n" while <$rdr>;
}

> FH is not normally represented as a scalar variable.
you can do that

> What role does $pid play?
you can get exit status,error,signal of the child


hth,

Mark G> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to