summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-30 17:28:45 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-30 17:28:45 +0000
commitbe41e5d9d9cfcfb109a0aa6168e91932d29ac79e (patch)
treef20ee1a3068924bc6b102f454a2feac379bba37e /perl.c
parentec3bab8e3bf51c4a5f1cb8ab2f17c1c54f83967b (diff)
downloadperl-be41e5d9d9cfcfb109a0aa6168e91932d29ac79e.tar.gz
A terser way of implementing require_pv.
p4raw-id: //depot/perl@25029
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/perl.c b/perl.c
index 57a9471e9e..5d5ec62397 100644
--- a/perl.c
+++ b/perl.c
@@ -2719,11 +2719,8 @@ Perl_require_pv(pTHX_ const char *pv)
dSP;
PUSHSTACKi(PERLSI_REQUIRE);
PUTBACK;
- sv = sv_newmortal();
- sv_setpv(sv, "require '");
- sv_catpv(sv, pv);
- sv_catpv(sv, "'");
- eval_sv(sv, G_DISCARD);
+ sv = Perl_newSVpvf(aTHX_ "require q%c%s%c", 0, pv, 0);
+ eval_sv(sv_2mortal(sv), G_DISCARD);
SPAGAIN;
POPSTACK;
}