Exporter::require_version almost never gets called. See (tye)Re: Overriding Exporter::import.
I found it funny (and a little sad) that perldata.pod defines this new type of literal but avoids giving it a name. The 5.6.0 pods don't ever mention "v-string" but do eventually refer to these as "vectors of (ordinals|integers)".
As best as I can tell, there is absolutely no way to distinguish v53.46.52 from "5.4" once perl has parsed it. You could cheat a little and assume that if the version scalar already has a numeric value cached inside of it, then it probably isn't a ordinal vector.
You can use Devel::Peek to determine this or use the old hack:
my $version= shift; if( "0" eq ( $version ^ $version ) ) { # $version already has a numeric value } else { # $version is _only_ a string }
Checking the code in universal.c, I see that the default method does something similar:
- tye (but my friends call me "Tye")if (!SvNIOK(sv) && SvPOK(sv)) { # ... } /* if we get here, we're looking for a numeric comparison,
In reply to (tye)Re: v1.2.3 syntax
by tye
in thread v1.2.3 syntax (vector of ordinals)
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |