[Melbourne-pm] Wierd CGI Error - different displays for different executers

Benji Wakely benji at arsimagica.net
Wed Mar 22 17:08:03 PST 2006

On Thu, 23 Mar 2006 11:30:52 +1100, 
"Sam Brent" <sambrent at gmail.com> wrote:

>Has anyone ever had a CGI script that creates the right output when
>run in a terminal but the incorrect ouput when run in a browser?

Quite a few times...

Simple things to check:

For me, it was nearly always down to the perl script relying on 
environment variables that weren't available when it was invoked
as a cgi.
It's also probable that it's an entirely different user that's
running the script.
("you" from the command line, "apache" from the web for example.)

>but prints that actually use perl to get their parameters like reading
>from a file then printing the output go nowhere.

Are your file/pathnames fully qualified?
	$infile = "$HOME/file.dat";
might be better off replaced by
	$infile = "/home/me/file.dat";


More information about the Melbourne-pm mailing list