Forgive my naivety here I'm just trying to learn stuff and none of this is going into any production.
I have test.cgi :
print "Content-type: text/html\n\n";
my @ret = `./runthis.pl`;
In runthis.pl I have:
print "Hellow World";
Now, locally on my machine, if I run test.cgi as test.pl from the command line this gives @ret length as 1 and shows $ret as hellow world. BUT on my apache server the array shows with a length of 1 but the output hello world doesn't show.
- Do I need to change the STDOUT on runthis.pl? If so how?
- Are there better ways to run a SAFE script as a cgi on apache and get its output into a variable? (The script is just going to output string/text)
In the end this is what worked with some trial/error suggestions from the good folk here
my @ret = qx(/usr/bin/perl ./runthis.pl`);