*nix systems frequently omit . (the current directory) from
the path and CGI environments may not have a path at all.
(Both of these, by the way, are Good Things for security.)
Now that we know why you have this problem, how to fix it?
- $ENV{'PATH'} .= '.'; - Should work, but leaves
you vulnerable to trojan executables in the current
directory. Probably not a real good idea.
- $output=`cat $filename | ./extract-info`; - Also
should work, but leaves you at the mercy of where your
current directory is. Could cause problems later if things
get moved around.
- $output=`cat $filename | /full/path/to/extract-info`;
- This is a nicely robust way of doing it and is the way that
I would opt for.
Also,
taint is your friend - especially if you're
doing things like
cat $filename!
Update: Corrected #1. For some reason, I originally
showed how to add . to @INC instead of
$ENV{'PATH'}. Must be lack of sleep...