summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-01-21 15:03:03 +0000
committerNicholas Clark <nick@ccl4.org>2009-01-21 17:09:11 +0000
commit64ace3f88f559d007c0150d9b048b1db32380208 (patch)
tree042e7da9dbe9f7d2a0291fe3763130f50198e559 /perl.c
parentcbfd0a879b2bf2ade4a309e6d56c08ba19f320e1 (diff)
downloadperl-64ace3f88f559d007c0150d9b048b1db32380208.tar.gz
Update the documentation of get_sv() to note that it calls Perl_gv_fetchpv(),
and hence the 'create' argument is actually 'flags'. Fix core code and documentation that used TRUE or FALSE to use 0 or GV_ADD.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/perl.c b/perl.c
index 95848f1174..f808af8ec9 100644
--- a/perl.c
+++ b/perl.c
@@ -2415,21 +2415,22 @@ S_run_body(pTHX_ I32 oldscope)
=for apidoc p||get_sv
-Returns the SV of the specified Perl scalar. If C<create> is set and the
-Perl variable does not exist then it will be created. If C<create> is not
-set and the variable does not exist then NULL is returned.
+Returns the SV of the specified Perl scalar. C<flags> are passed to
+C<gv_fetchpv>. If C<GV_ADD> is set and the
+Perl variable does not exist then it will be created. If C<flags> is zero
+and the variable does not exist then NULL is returned.
=cut
*/
SV*
-Perl_get_sv(pTHX_ const char *name, I32 create)
+Perl_get_sv(pTHX_ const char *name, I32 flags)
{
GV *gv;
PERL_ARGS_ASSERT_GET_SV;
- gv = gv_fetchpv(name, create, SVt_PV);
+ gv = gv_fetchpv(name, flags, SVt_PV);
if (gv)
return GvSV(gv);
return NULL;
@@ -3069,7 +3070,7 @@ Perl_moreswitches(pTHX_ const char *s)
PL_rs = newSVpvn(&ch, 1);
}
}
- sv_setsv(get_sv("/", TRUE), PL_rs);
+ sv_setsv(get_sv("/", GV_ADD), PL_rs);
return s + numlen;
}
case 'C':
@@ -3590,7 +3591,7 @@ S_init_main_stash(pTHX)
PL_globalstash = GvHV(gv_fetchpvs("CORE::GLOBAL::", GV_ADDMULTI,
SVt_PVHV));
/* We must init $/ before switches are processed. */
- sv_setpvs(get_sv("/", TRUE), "\n");
+ sv_setpvs(get_sv("/", GV_ADD), "\n");
}
STATIC int
@@ -4563,7 +4564,7 @@ S_init_predump_symbols(pTHX)
GV *tmpgv;
IO *io;
- sv_setpvs(get_sv("\"", TRUE), " ");
+ sv_setpvs(get_sv("\"", GV_ADD), " ");
PL_ofsgv = (GV*)SvREFCNT_inc(gv_fetchpvs(",", GV_ADD|GV_NOTQUAL, SVt_PV));
PL_stdingv = gv_fetchpvs("STDIN", GV_ADD|GV_NOTQUAL, SVt_PVIO);