Why is this "use" a syntax error?
Many Perl developers are unaware that they can assert a module version with an import list at the same time. For example:
use Test::More 0.96 tests => 13;
However, the following is a syntax error:
use Test::More .96 tests => 13;
Frankly, I don't know why. Here's a program which demonstrates my confusion. It exhibits more or less the same behavior on 5.8.9, 5.10.1, 5.12.4 and 5.14.2.
And the output is:
SV = NV(0x7fc84083a5e8) at 0x7fc84082be90
REFCNT = 2
FLAGS = (NOK,READONLY,pNOK)
NV = 0.96
SV = NV(0x7fc84083a5e0) at 0x7fc840800fd0
REFCNT = 2
FLAGS = (NOK,READONLY,pNOK)
NV = 0.96
Argument "2.121_17" isn't numeric in subroutine entry at (eval 2) line 2.
Error is: none
---------------------------
String found where operator expected at (eval 3) line 1, near ".01 'Dumper'"
(Missing operator before 'Dumper'?)
Error is: syntax error at (eval 3) line 1, near ".01 'Dumper'"
The Devel::Peek shows that both numbers are the same, as far as Perl is concerned, but using .96 for the version is a syntax error. Reading perldoc use hasn't cleared this up for me. Is this a parsing bug or is there something else going on?