jameshutchinson008
IS-IT--Management
Hello all,
I am having problems reading the result of an external application. This problem only manifests itself when running from a web server via a browser; works fine from the cli.
if I enable use warnings I am warned the $output variable has not been initialized.
Cheers,
James.
I am having problems reading the result of an external application. This problem only manifests itself when running from a web server via a browser; works fine from the cli.
Code:
#Redirect stderr to the browser
open(STDERR, ">&STDOUT");
use CGI ':standard';
$cgi = new CGI;
#use warnings;
print header();
#Example external application hosted on a windows web server
$cmd = "echo james";
$output = `$cmd 2>&1`;
#display the results of the external command
print "$output\n";
if I enable use warnings I am warned the $output variable has not been initialized.
Cheers,
James.