http://www.perlmonks.org?node_id=701015

Niel has asked for the wisdom of the Perl Monks concerning the following question:

The output of any our product command (like ebs --version) cannot be stored in a variable/file. (But same works fine if it’s a system command like date, ls etc on linux m/c). Is there way out to store this output into any file/variable? Below is the code in perl and it worked if the $command = ls but doesn’t work if the $command = “ebs --version”. Can you please give some input on this? Script is as follows…
$command = ls;
my $test = "/usr/anil/scripts/anil1.txt";
open (STDOUT, "> $test");
$t = system("$command");