saranrsm has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks
I have been lately wondering, if I could pass the output generated by an external binary file or executable file, which has been invoked by system command and that generates some output. What usually I do is, I write the output in a file and then read the output via normal file handling and parse the output or what ever I intend to do.
########################### ## ## $input contains the necessary parameters for the external executab +le file and the output is generated into output_file created ## ########################### `some_external_excutable_file $input >output_file` open (OUTPUT,"output_file"); @output=<OUTPUT>; close OUTPUT; ############################ ## ## I read the output file into an array and use the array for my furt +her analysis ## ############################
But the spurring question here is, isn't there any other way to pass the output generated by the external executable directly into an array rather than the way I did. Is there any default variable for accomplishing it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to pass the output into an array
by cdarke (Prior) on May 17, 2012 at 07:07 UTC | |
|
Re: How to pass the output into an array
by kcott (Archbishop) on May 17, 2012 at 07:15 UTC |