What is the real purpose of the $VERSION variable in Perl? -
i've read it's considered practice include $version
number in of perl scripts, never understood purpose.
what gain including version number in script?
only modules, , pushed cpan benefit specifying $version
. there's not use in script except use familiar name rather inventing new 1 if want script's version accessible.
primary uses:
cpan uses version of distribution, allowing index different versions of same distribution.
cpan
,cpanm
uses check if installed module of sufficiently high level meet required minimum version of dependency.
as brian d foy mentioned, can checked use foo 1.23;
, people avoid in favour of specifying required versions of dependencies in distribution's meta file. allows cpan
, cpanm
update dependency if needed (where use using use foo 1.23;
cause installation fail during testing). due lack of use of feature, it's hardly primary use.
Comments
Post a Comment