[mapserver-users] Perl/mapscript error
Puneet Kishor
pkishor at GeoAnalytics.com
Sat Apr 27 08:52:40 PDT 2002
I rebuilt Mapserver and mapsript. The stock examples (shpinfo.pl and
dump.pl) work fine. But then...
I am trying out the simplest of code (after sdl's mapquakes.pl)...
1: my $rootdir = "/Users/pkishor/Sites/ms";
2: my $imgdir = "/$rootdir/tmp/";
3: my $imgurl = "/~pkishor/ms/tmp/";
4: my $map = "/$rootdir/map/my.map";
5: my $imgid = $$ . time() . ".png";
6: my $mapobj = new mapObj("$map");
7: my $img = $mapobj->prepareImage();
8: mapscript::msSaveImage($img,
$imgdir . $imgid,
$mapobj->{imagetype},
$mapobj->{transparent},
$mapobj->{interlace},
$mapobj->{imagequality});
I get the following error... obviously prepareImage is failing because
$mapobj can't be created on line 6 to begin with. What is causing the
following "Uncaught exception..."
[Sat Apr 27 10:18:27 2002] [error] Uncaught exception from user code:
Can't call method "prepareImage" on an undefined value at
/Users/pkishor/Sites/palatine/perl/index.pl line 16.
Apache::ROOT::_7epkishor::palatine::perl::index_2epl::handler('Apache=SCALAR(
0xcccd0)') called at /System/Library/Perl/darwin/Apache/Registry.pm line
143
eval {...} called at /System/Library/Perl/darwin/Apache/Registry.pm
line 143
Apache::Registry::handler('Apache=SCALAR(0xcccd0)') called at
/dev/null line 0
eval {...} called at /dev/null line 0
[Sat Apr 27 10:34:49 2002] [error] Can't call method "prepareImage" on
an undefined value at /Users/pkishor/Sites/palatine/perl/index.pl line
16.
More information about the MapServer-users
mailing list