On Sun May 07 09:51:09 2017, TOBYINK wrote:
Show quoted text> On 2014-02-13T09:55:14Z, zefram@fysh.org wrote:
> > This change was a bugfix. Those functions are documented to perform
> > a
> > version check if the version paramater is supplied, not if it's
> > supplied
> > and not undef. It is not M:R's business to prejudge what a module
> > will
> > accept as a version number to test against.
>
> For what it's worth, this is actually inconsistent with Perl's built-
> in `use` implementation:
>
> perl -e'BEGIN{package Foo;$INC{"Foo.pm"}=__FILE__;use Data::Dumper;sub
> VERSION{print "VERSION\n",Dumper(@_)}sub import{print "import\n",
> Dumper(@_)}}; use Foo 1'
>
> Output:
>
> VERSION
> $VAR1 = 'Foo';
> $VAR2 = 1;
> import
> $VAR1 = 'Foo';
>
>
> perl -e'BEGIN{package Foo;$INC{"Foo.pm"}=__FILE__;use Data::Dumper;sub
> VERSION{print "VERSION\n",Dumper(@_)}sub import{print "import\n",
> Dumper(@_)}}; use Foo 1'
I think you meant ‘use Foo undef’ there.
Show quoted text>
> Output:
>
> import
> $VAR1 = 'Foo';
> $VAR2 = undef;
>
>
> So when `use Module undef` is encountered by Perl, MODULE-
> >VERSION(undef) is *not* called.
This is unrelated. Whether VERSION is called has nothing to do with whether what follows the module name is defined. It has to do with whether it looks like a version number. ‘use Foo "3"' also does not call VERSION, but that does not mean Module::Runtime should reject "3" as a version.