This turned out to not be a Perl problem at all. Turns out
there were two issues that were causing the problem:
- The value for $ENV{"HOME"} is undefined
when running the script as a CGI due to the way the
hosting company sets up its server environment. I
solved this by hardcoding the pasth. (I hate doing that)
- Turned out the server was configured such that there is
a restriction on the mime types a CGI script can send. The
hosting company's philosophy is if you aren't smart enough
to ask for an exception you don't get the exception.
Once they added "image/png" to their list
for my virtual server all was good.
What was partially tripping me up was the script ran
fine from the command line even remotely as in
ssh ${server} ${path}/sendRandomImage.pl
and did what I expected.
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg