in reply to Testing Input and Output
Ever tried redirecting a child stdin or stdout with open()?
open( HANDLE, "ls -l |" ) or die "Unable to exec 'ls'\n";
while( <HANDLE> ) {
#Process each line of output '$_'
}
close( HANDLE );
I do this all the time when I want to execute a child process and evaluate it's output.
HTH,
James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Testing Input and Output
by grep (Monsignor) on Sep 02, 2002 at 07:02 UTC |