From: Nicholas Clark Date: Thu, 30 Jun 2005 17:28:45 +0000 (+0000) Subject: A terser way of implementing require_pv. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=be41e5d9d9cfcfb109a0aa6168e91932d29ac79e;p=p5sagit%2Fp5-mst-13.2.git A terser way of implementing require_pv. p4raw-id: //depot/perl@25029 --- diff --git a/perl.c b/perl.c index 57a9471..5d5ec62 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; }