[mapserver-users] MapScript Perl-CGI/Problems

Jim Burnett jimburnett at ntelos.net
Fri Jul 20 10:49:18 EDT 2001


I am having a problem printing out simple HTMP using the mapscript perl mod.
This is the only error that I get in my logs.

[Fri Jul 20 10:43:42 2001] [error] [client 192.168.1.47] Premature end of script headers: /ho

 Here is some code that I am using. When I comment out the 3   $map=  , $img= and mapscript::msSaveImage   lines it works. 
Now, if I comment out the  "use CGI"  code, and NOT the mapscript code, then it works!
So I am wondering, is there conflicts with CGI.pm and Mapscript.pm ?


print "Content-type: text/html\n\n";
$mapPath ="/home/jburnett/maptest";
$imgTemp ="/home/htdocs/tmp";
use mapscript;
use CGI;
my $q = new CGI;
my $imgX = $q->param('img.x');
my $imgY = $q->param('img.y');

  $map = new mapObj("$mapPath/romney.map") or die($!. "::Unable to open mapfile.");
  $img = $map->draw() or die('Unable to draw map');
  mapscript::msSaveImage($img, "$imgTemp/example.gif", $map->{interlace}, $map->{transparent});

print"
<html><head><title>Perl Mapserver Test</title></head>\n
<body>
<b>$imgX X $imgY</b><br>
<img src='/tmp/example.gif'>
<form action='/cgi-bin/romney.pl' method='post'>
";


Apache/1.3.12 
Perl v5.6.0
Slackware 7.1

thanks!

-jim





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20010720/e13e5f42/attachment.html


More information about the mapserver-users mailing list