gideondsouza has asked for the wisdom of the Perl Monks concerning the following question:
Forgive my naivety here I'm just trying to learn stuff and none of this is going into any production.
I have test.cgi :
use strict; use warnings; print "Content-type: text/html\n\n"; print "Test"; my @ret = `./runthis.pl`; print length(@ret); print $ret[0];
In runthis.pl I have:
use strict; use warnings; 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[0] as hellow world. BUT on my apache server the array shows with a length of 1 but the output hello world doesn't show.
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`);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: output of one program doesn't show in another on server
by NetWallah (Canon) on Dec 18, 2012 at 04:39 UTC | |
|
Re: output of one program doesn't show in another on server
by AnomalousMonk (Archbishop) on Dec 18, 2012 at 04:38 UTC | |
|
Re: output of one program doesn't show in another on server
by mbethke (Hermit) on Dec 18, 2012 at 06:47 UTC | |
by gideondsouza (Pilgrim) on Dec 18, 2012 at 16:25 UTC | |
by AnomalousMonk (Archbishop) on Dec 18, 2012 at 17:38 UTC | |
by gideondsouza (Pilgrim) on Dec 19, 2012 at 06:36 UTC | |
by gideondsouza (Pilgrim) on Dec 19, 2012 at 14:18 UTC |