[mapserver-dev] mapscript swig modperl

Andy Colson andy at squeakycode.net
Mon Aug 17 20:54:38 EDT 2009


Hi Devs,

I'm having a problem in perl mapscript.

As a normal perlscript (run from command line, or cgi or fastcgi) it works ok, but when run under modperl I have problems.

This line works:
my $map = new mapscript::mapObj("/pub/maps/test.map");


This does not:
my $s = "/pub/maps/test.map";
my $map = new mapscript::mapObj($s);

I get error:
TypeError in method 'new_mapObj', argument 1 of type 'char *'

Here is my test script:

use strict;
use aweb;
use mapscript;

my $web = aweb->new(shift);
$web->content_type("text/html");


#my $s = "/pub/maps/test.map";
#my $map = new mapscript::mapObj($s);
my $map = new mapscript::mapObj("/pub/maps/test.map");
if (! $map)
{
        print "failed to load<br>";
} else {
        print "loaded<br>";
}




Any help would be appreciated.

-Andy


More information about the mapserver-dev mailing list