diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-09-08 20:45:20 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-09-08 21:36:40 -0700 |
commit | 77cb3b015781b8e3c7ee73c313ba18cd16dfb442 (patch) | |
tree | b5b8ecc07baf116844af218e14590a0c655af2f3 /gv.c | |
parent | b1b24ee7afadda660049b2e5ed5e566d8d3babbc (diff) | |
download | perl-77cb3b015781b8e3c7ee73c313ba18cd16dfb442.tar.gz |
Enter gv_fetchsv_nomg
There are so many cases that use this incantation to get around
gv_fetchsv’s calling of get-magic--
STRLEN len;
const char *name = SvPV_nomg_const(sv,len);
gv = gv_fetchpvn_flags(name, len, flags | SvUTF8(sv), type);
--that it’s about time we had a shorthand.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1004,7 +1004,8 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, const svtype sv_type) { GV * Perl_gv_fetchsv(pTHX_ SV *name, I32 flags, const svtype sv_type) { STRLEN len; - const char * const nambeg = SvPV_const(name, len); + const char * const nambeg = + SvPV_flags_const(name, len, flags & GV_NO_SVGMAGIC ? 0 : SV_GMAGIC); PERL_ARGS_ASSERT_GV_FETCHSV; return gv_fetchpvn_flags(nambeg, len, flags | SvUTF8(name), sv_type); } |