system function only returns the exit status of the command; if you want to capture the output, you should use backticks:
$result = `command`;
Then, you can write this output to wherever you want it with something like this:
open OUTFILE, "> /path/to/outfile.txt";
print OUTFILE $result;
close OUTFILE;
Alternately, if you do not want to process the output in Perl, you can just do something like this:
system("command > /path/to/result.txt");
However, in this case you probably wouldn't need to use Perl for it at all...
HTH
--------------------------------
An idea is not responsible for the people who believe in it...
|