[Mapserver-users] another perl mapscript problem

Dana Quinn dana at nextbus.com
Tue Dec 17 13:11:19 EST 2002


Hi - I'm having another perl mapscript problem, and I
was hoping someone could help me find a clue.  Basically,
I'm trying to get a pre-existing perl cgi we have working
with the 3.6.3 version of mapserver, perl 5.8, and
RedHat Linux 8.0.  I'm almost there, and I think probably
some stupid problem is keeping me from finishing this.

Here's a code snippet - we've done all our image creation
work, and we're ready to output it to the browser - (we
are using CGI.pm, btw):

 >
print $query->header('image/gif');

#
$img->saveImage(undef,$mapscript::MS_GIF, $map->{transparent}, 
$map->{interlace}, 0);
 >

very simple, yeah?  If I change the 'saveImage' call to write
to a file on the filesystem, it works perfectly, I get a
saved gif that I'm able to view, and it works great.

If I use undef, like above, to output to the browser, I
get a '500 Server Error', and get this in my server error
logs:
[Mon Dec 16 18:29:28 2002] [error] [client 64.164.28.194] malformed 
header from script. Bad header=GIF87aX^B<F4>^A<E7>: 
/usr/local/apache/cgi-bin/mapserv.pl

It kinda looks like the browser isn't seeing the Content-Type
header...  but that's what the 'query->header' business is
supposed to do.  So I've tried printing it by hand, no dice.
There must be some stupid thing I'm missing - does anyone have
any ideas what I'm doing wrong?

Dana

-- 

Dana Quinn, dana at nextbus.com
NextBus Information Systems
(510) 420-3117




More information about the mapserver-users mailing list