summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-03 09:29:37 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-03 09:29:37 +0000
commit7dfde25db661bada3e1f19c61513f0bac481ca05 (patch)
tree7c2c5eb16aba099a3c25f64ee5262b27c394580a /pp_ctl.c
parentdb7bf7291a2d4c87f0ded67aeafc51c0a18c2fcd (diff)
downloadperl-7dfde25db661bada3e1f19c61513f0bac481ca05.tar.gz
Make use VERSION also load feature.pm
p4raw-id: //depot/perl@30446
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 3aecb2dd9d..c9a7f58fcd 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3102,7 +3102,18 @@ PP(pp_require)
SVfARG(vnormal(sv)), SVfARG(vnormal(PL_patchlevel)));
}
- RETPUSHYES;
+ /* If we request a version >= 5.9.5, load feature.pm with the
+ * feature bundle that corresponds to the required version.
+ * We do this only with use, not require. */
+ if (PL_compcv && vcmp(sv, sv_2mortal(upg_version(newSVnv(5.009005)))) >= 0) {
+ SV *const importsv = vnormal(sv);
+ *SvPVX_mutable(importsv) = ':';
+ ENTER;
+ Perl_load_module(aTHX_ 0, newSVpvs("feature"), NULL, importsv, NULL);
+ LEAVE;
+ }
+
+ RETPUSHYES;
}
name = SvPV_const(sv, len);
if (!(name && len > 0 && *name))