diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-06 01:35:38 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-06 02:10:04 -0800 |
commit | 52a6327bb1a7bdbfce3ca5a5bdd9de4531dbaf69 (patch) | |
tree | 8791e2cf0e9c6977adc24b429c230d10da925552 /pp.c | |
parent | a4a3cf7419a4f30455db08fefe2cac688567ac22 (diff) | |
download | perl-52a6327bb1a7bdbfce3ca5a5bdd9de4531dbaf69.tar.gz |
[perl #96326] *{$io} should not be semi-defined
gv_efullname4 produces undef if the GV points to no stash, instead of
using __ANON__, as it does when the stash has no name.
Instead of going through hoops to try and work around it elsewhere, fix
gv_efullname4.
This means that
$x = *$io;
$x .= "whate’er";
no longer produces an uninitialized warning. (The warning was rather
strange, as defined() returned true.)
This commit also gives the glob the name $__ANONIO__ (yes, with a dol-
lar sign). It may seem a little strange, but there is precedent in
other autovivified globs, such as those open() produces when it cannot
determine the variable name (e.g, open $t->{fh}).
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -165,7 +165,7 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool strict, sv = SvRV(sv); if (SvTYPE(sv) == SVt_PVIO) { GV * const gv = MUTABLE_GV(sv_newmortal()); - gv_init(gv, 0, "", 0, 0); + gv_init(gv, 0, "$__ANONIO__", 11, 0); GvIOp(gv) = MUTABLE_IO(sv); SvREFCNT_inc_void_NN(sv); sv = MUTABLE_SV(gv); |