Perl module version checking

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Wed Nov 15 15:18:57 EST 2006


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