At 05:52 19.05.2001 -0700, you wrote:
>I wrote a cgi script in perl that successfully calls a program which
>returns a gif image, but the image is not returned to the browser,
>rather it ends up in script_log and a I get a broken image place
>holder in the browser?!
>
>Any clues?
>
>      --jab


>#!/usr/bin/perl -w
>
>################################################################
># SingleChart.pl
># generate a chart in HTTP response format, i.e. it contains HTTP
># mime header and the image binary data.
>################################################################

Though it doesn't have anything to do with your problem, I highly recommend 
using 'strict' -- it keeps silly typo errors for popping up, among other 
things.

>require("./cgi-lib.pl") ||  die "can't locate cgi-lib.pl";
>require("./share-lib.pl") ||  die "can't locate share-lib.pl";

If you do use strict, you'll probably have problems requiring the above 
scripts -- this is a good thing.  You'll notice that if you have two 
functions with the same name in your SingleChart.pl and in one of the above 
required scripts, things will get funky.  Using strict also forces you to 
keep your namespace clean.

>&ReadParse(*para);
>$| = 1;
>#&checkSCode;
>foreach $name ( keys(%para) ) {
>         push(@query, "$name=$para{$name}");
>}
>$comline = join("\\\&", @query);
>#print $comline;
># generate the chart by calling 'gifChart'
>system("./gifChart $comline");

I notice that you don't send anything back to the browser.  I don't know 
what your gifChart program does.  Have you tried setting some variable to 
the output that you get from gifChart and then sending that back to the 
browser?


Aaron Craig
Programming
iSoftitler.com

Reply via email to