another option would be to open the command using the pipe syntax:
open CMD, '-|', 'util.exe';
# Another way to do this is:
#open CMD, 'util.exe |';
while(my $line = <CMD>){
# parse & process stuff
}
close CMD;
If you need to capture STDERR or do input and output at the same time,
you may want to look at open2 or open3.
- Johnathan
Felix Geerinckx wrote:
>on Thu, 30 May 2002 05:58:53 GMT, [EMAIL PROTECTED] (Alan C.)
>wrote:
>
>
>
>>So, want to know how for Perl to launch the .exe then Perl capture
>>from STDOUT into either a text file or a variable as my final goal
>>is to view such captured output in a text editor.
>>
>>
>
>Use backticks or the equivalent qx function, either in scalar or list
>context:
>
> my $output = qx(util.exe); # $output contains full output
> my @lines = qx(util.exe); # @lines contains full output, on line
> # per array-element
>
>See
> perldoc perlop
>
>for more information.
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]