if (SvTYPE(sv) >= SVt_PVGV) {
gv = (GV *) sv;
- if (!val) { /* local *x; */
+ if (!val || !SvROK(val)) { /* local *x; or local *x = $val; */
t = SVt_PVGV;
- } else if (!SvROK(val)) { /* local *x = $val; */
- goto assign;
- } else { /* local *x = \$val; */
+ } else { /* local *x = \$val; */
t = SvTYPE(SvRV(val));
deref = 1;
}
ud, PL_savestack_ix,
PL_scopestack[PL_scopestack_ix]));
-assign:
if (val)
SvSetMagicSV((SV *) gv, val);
is $x, undef, 'localize *x, obj => HERE [end]';
}
+our $y;
+
{
- local $x = 2;
+ local $x = 1;
+ local $y = 2;
{
- local $x = 3;
- localize *x, 1 => HERE;
- is $x, undef, 'localize *x, 1 => HERE [ok]';
+ local $y = 3;
+ localize *x, 'y' => HERE;
+ is $x, 3, "localize *x, 'y' => HERE [ok]";
}
- is $x, $] < 5.008009 ? undef : 2, 'localize *x, 1 => HERE [end]';
+ is $x, 1, "localize *x, 'y' => HERE [end]";
}
undef *x;