[mapserver-users] Unsetting parameters in Perl/MapScript

Steve Lime steve.lime at dnr.state.mn.us
Wed Nov 20 15:53:58 EST 2002


What you need is the perl equivalent to NULL in C. I know you can pass
undef as an argument to SWIG generated functions and it is interpreted
as NULL on the C side. Have you tried:

   $map->{web}->{error} = undef;

The Perl interface also has a set/get syntax similar to the PHP
version. Supposedly the hash notation is supposed to reference that
underlying code, but perhaps it's not. Anyway, try the above and we'll
work something out to fix the problem if it fails. For most numeric
parameters setting them to -1 (unless true/false applies) often works.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Lowell Filak" <lfilak at medinaco.org> 11/18/02 08:17AM >>>
Are you able to undef the web object and build a new one?
Lowell F.

The following message was sent by Jean-Francois.Doyon at ccrs.nrcan.gc.ca
on Fri, 15 Nov 2002 18:26:56 -0500.

> 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-Frantois 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