I do recall that there has been discussion to add your requested feature to Perl6, that it will be possible to have multiple versions of modules with the same name, and you to select the version you want. I think it'll even possible to have multiple versions of a module loaded at the same time, in the same script, which most definitely isn't possible in perl5, is their package contents (they use the same package name) would clash.
Let's just say that for Perl5, Larry was a bit naive, assuming, just like Microsoft did with its versioning of system DLL's, that newer versions would always be backward compatible with older ones, and that all you ever needed was the newer version. However, this cannot be kept up in the long run. It has bitten me already, now that HTML::Parser version 3 isn't even compatible with version 2 any more, as the "text" callback has more arguments and thus the "last argument" is something entirely different between the two module versions. As a result, I can't upgrade without rewriting my scripts. BTW It uses HTML::TokeParser, not HTML::Parser directly, but the former gets all its arguments from the callback calls in the latter, so it is affected, too.
Let me take a look at the Exporter docs for require_version():
The Exporter module will convert an attempt to import a number from a module into a call to $module_name->require_version($value). This can be used to validate that the version of the module being used is greater than or equal to the required version.What's not clear? It means that in case of your call,The Exporter module supplies a default require_version method which checks the value of $VERSION in the exporting module.
this will construct a call:use MIME::Types 1.005;
for which either the module has provided a method, which does the checking itself, or, if this method doesn't exist (I guess that's the more common case, it's the case for MIME::Types) this will call a fallback method through inheritance, which compares the argument given to the variable $VERSION of the package, in this case, to $MIME::Types::VERSION; and croak if the module is not new enough.MIME::Types->require_version(1.005);
In reply to Re: Module Version Checking - Checking Multiple Installations of the Module
by bart
in thread Module Version Checking - Checking Multiple Installations of the Module
by skazat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |