Closed p5pRT closed 14 years ago
This is an update on the 3 items recommended:
* 'use NAME VERSION' has loose VERSION checks that can unexpectedly pass the VERSION as an argument to import. Even if it passes the loose check\, it dies later in UNIVERSAL::VERSION unless the 'lax' check passes. Therefore\, we should add 'lax' version checks explicitly to 'use NAME VERSION' parsing
Still to be done. The paring for 'use NAME VERSION' is actually rather complex to disambiguate from 'use VERSION' or 'use NAME VERSION' or 'use NAME ARGS'. Ideally\, if this parsing can process VERSION with scan_version\, it can solve the next issue as well. This still needs to be done\, preferably by someone with good toke.c experience.
* Three digit number strings created under a comma-radix could fail to pass the 'lax' test. Therefore\, we should always use the NV in Perl_upg_version if SvNOK is true\, without regard for SvPOK. We should probably check for it being a v-string\, first\, anyway\, as v-string has no ambiguity about how it is to be treated.
Still to be done.
* Have version->new(undef) create a new version with "0" instead of "undef" (this should have no real effect except it won't break later if we make everything strict)
Done with commit a2bff36
After evaluating the remaining items\, I've concluded that the resulting change is too risky at this point and needs to wait until 5.13.
In short\, changing 'use NAME VERSION' from scan_num to scan_version impacts toke.c\, op.c and pp_ctl.c. There are numerous places that expect VERSION to be a dual-var and not a version object. There is at least one test that overrides CORE::GLOBAL::require and expects a version argument to be numeric. (There may be similar code on CPAN.)
I have updated the perldelta documentation to be clear that "lax" rules are not applied to 'use NAME VERSION' until after Perl processes VERSION as a numeric literal or v-string.
I'm closing this ticket and will reopen a new (non-blocking) ticket as a reminder for the future.
@xdg - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#70866 (status was 'resolved')
Searchable as RT70866$