[mapserver-users] Unsetting parameters in Perl/MapScript

Steve Lime steve.lime at dnr.state.mn.us
Mon Dec 9 11:45:09 EST 2002


JF: I did some checking and hacking in the mapscript_wrap.c file that
Swig generates. There's an error in it. Doing something like:

  $map->{name} = undef;

does get a NULL value into the C code, but the Swig wrapper code doesn't
check for the NULL and does stuff like strlen and strcpy on it which
gives the seg fault. I've alerted the Swig folks to the bug and can
provide you with a quick work around if you're only concerned with a
parameter or two.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> <Jean-Francois.Doyon at ccrs.nrcan.gc.ca> 11/15/02 18:11 PM >>>
Hello,

How does one "unset" a parameter set in a mapfile ?

I load a mapfile that has the ERROR template set in the WEB object, and
I
want to remove it entirely.

I've tried $map->{web}->{error} = "", but that just sets it to empty ...
if
I try undef $map->{web}->{error}, I get a segfault !, I tried setting it
with = 0 (false), but then it just takes the value 0 and uses it as a
string
...

Any ideas ?

Thanks,

Jean-François Doyon
Internet Service Development and Systems Support
GeoAccess Division
Canada Center for Remote Sensing
Natural Resources Canada
http://atlas.gc.ca
Phone: (613) 992-4902
Fax: (613) 947-2410






More information about the mapserver-users mailing list