Perl module version checking

Steve Lime Steve.Lime at DNR.STATE.MN.US
Thu Nov 16 11:35:01 EST 2006


I sounds useful to me. If not for other languages then perhaps this
could be done through the plmodule.i interface
file. This must be done fairly often and documented someplace on the
Swig website.

Steve

>>> "Kralidis,Tom [Burlington]" <Tom.Kralidis at EC.GC.CA> 11/15/2006
2:18:57 PM >>>
Hi,

Mapscript defines MS_VERSION to derive the version of mapscript used
(i.e. 4.10.0, etc.).

Perl language allows for specifying modules by version, i.e.:

#!/usr/bin/perl

use strict;
use warnings;
use mapscript 4.10.0;

Perl language processes this by checking the version specified against
the VERSION variable used to identify Perl modules.

When attempting the script snippet above, the result is:

mapscript does not define $mapscript::VERSION--version check failed at
proxim2prop.pl line 9.
BEGIN failed--compilation aborted at foo.pl line 9.

I have run into a couple of situations where version checking like this
is required.

Suggest we add a VERSION variable to mapscript.pm.  I think it would be
valuable given the issue above, and especially since it is Perl idiom to
do so.

Comments?

..Tom



More information about the mapserver-dev mailing list