sv = POPs;
if (SvNIOKp(sv)) {
- UV rev, ver, sver;
- if (SvPOKp(sv)) { /* require v5.6.1 */
+ if (SvPOK(sv) && SvNOK(sv)) { /* require v5.6.1 */
+ UV rev = 0, ver = 0, sver = 0;
I32 len;
U8 *s = (U8*)SvPVX(sv);
U8 *end = (U8*)SvPVX(sv) + SvCUR(sv);
s += len;
if (s < end)
sver = utf8_to_uv(s, &len);
- else
- sver = 0;
}
- else
- ver = 0;
}
- else
- rev = 0;
if (PERL_REVISION < rev
|| (PERL_REVISION == rev
&& (PERL_VERSION < ver
"v%d.%d.%d, stopped", rev, ver, sver, PERL_REVISION,
PERL_VERSION, PERL_SUBVERSION);
}
+ RETPUSHYES;
}
else if (!SvPOKp(sv)) { /* require 5.005_03 */
if ((NV)PERL_REVISION + ((NV)PERL_VERSION/(NV)1000)
PERL_SUBVERSION);
}
}
+ RETPUSHYES;
}
- RETPUSHYES;
}
name = SvPV(sv, len);
if (!(name && len > 0 && *name))
break;
}
if (len) {
- if (SvNIOKp(req) && SvPOK(req)) {
+ if (SvNOK(req) && SvPOK(req)) {
/* they said C<use Foo v1.2.3> and $Foo::VERSION
* doesn't look like a float: do string compare */
if (sv_cmp(req,sv) == 1) {
/* if we get here, we're looking for a numeric comparison,
* so force the required version into a float, even if they
* said C<use Foo v1.2.3> */
- if (SvNIOKp(req) && SvPOK(req)) {
+ if (SvNOK(req) && SvPOK(req)) {
NV n = SvNV(req);
req = sv_newmortal();
sv_setnv(req, n);