http://qs1969.pair.com?node_id=7250


in reply to mysterious backticks/system() behavior in CGI script

Quick thoughts:

Try looking at the $! variable in your final else loop to see *why* the open failed. Rewrite the open line as:

if (open IMAGE_FILE, "$image_output.gif")

Run the script with a -wT and see if that tells you anything.

Check the path that the script runs as. This will be different from the command line path.

Replies are listed 'Best First'.
RE: Re: mysterious backticks/system() behavior in CGI script
by jwielgos (Initiate) on Apr 11, 2000 at 02:22 UTC
    Thanks for the -T tip, there were indeed some tainted variables. I fixed my $ENV("PATH"), and switched everything to use system(@list) instead of ``s. And I still don't know why, but between those two, somehow the problem went away. I'm not going to question a miracle, but there's definitely a lesson here: don't use ``s unless you really have to.. Anyway thanks everyone. Monks rock the house!