# 3 <$> gvsv(*a) s/OURINTR ->4
EONT_EONT
-checkOptree ( name => 'local $a',
- prog => 'local $a',
- errs => ['Name "main::a" used only once: possible typo at -e line 1.'],
+checkOptree ( name => 'local $c',
+ prog => 'local $c',
+ errs => ['Name "main::c" used only once: possible typo at -e line 1.'],
bcopts => '-basic',
strip_open_hints => 1,
expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
1 <0> enter ->2
2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
- <1> ex-rv2sv vKM/129 ->4
-3 <#> gvsv[*a] s/LVINTRO ->4
+3 <#> gvsv[*c] s/LVINTRO ->4
EOT_EOT
# 4 <@> leave[1 ref] vKP/REFC ->(end)
# 1 <0> enter ->2
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3
# - <1> ex-rv2sv vKM/129 ->4
-# 3 <$> gvsv(*a) s/LVINTRO ->4
+# 3 <$> gvsv(*c) s/LVINTRO ->4
EONT_EONT
pass("MY, OUR, LOCAL, BOTH SUB AND MAIN, = undef");
# 4 <$> gvsv(*a) s/OURINTR ->5
EONT_EONT
-checkOptree ( name => 'local $a=undef',
- prog => 'local $a=undef',
- errs => ['Name "main::a" used only once: possible typo at -e line 1.'],
+checkOptree ( name => 'local $c=undef',
+ prog => 'local $c=undef',
+ errs => ['Name "main::c" used only once: possible typo at -e line 1.'],
note => 'locals are rare, probably not worth doing',
bcopts => '-basic',
strip_open_hints => 1,
5 <2> sassign vKS/2 ->6
3 <0> undef s ->4
- <1> ex-rv2sv sKRM*/129 ->5
-4 <#> gvsv[*a] s/LVINTRO ->5
+4 <#> gvsv[*c] s/LVINTRO ->5
EOT_EOT
# 6 <@> leave[1 ref] vKP/REFC ->(end)
# 1 <0> enter ->2
# 5 <2> sassign vKS/2 ->6
# 3 <0> undef s ->4
# - <1> ex-rv2sv sKRM*/129 ->5
-# 4 <$> gvsv(*a) s/LVINTRO ->5
+# 4 <$> gvsv(*c) s/LVINTRO ->5
EONT_EONT
checkOptree ( name => 'sub {my $a=()}',
# 6 <@> leave[1 ref] vKP/REFC
EONT_EONT
-checkOptree ( name => 'local $a=()',
- prog => 'local $a=()',
- errs => ['Name "main::a" used only once: possible typo at -e line 1.'],
+checkOptree ( name => 'local $c=()',
+ prog => 'local $c=()',
+ errs => ['Name "main::c" used only once: possible typo at -e line 1.'],
#todo => 'probly not worth doing',
bcopts => '-exec',
strip_open_hints => 1,
1 <0> enter
2 <;> nextstate(main 1 -e:1) v:>,<,%,{
3 <0> stub sP
-4 <#> gvsv[*a] s/LVINTRO
+4 <#> gvsv[*c] s/LVINTRO
5 <2> sassign vKS/2
6 <@> leave[1 ref] vKP/REFC
EOT_EOT
# 1 <0> enter
# 2 <;> nextstate(main 1 -e:1) v:>,<,%,{
# 3 <0> stub sP
-# 4 <$> gvsv(*a) s/LVINTRO
+# 4 <$> gvsv(*c) s/LVINTRO
# 5 <2> sassign vKS/2
# 6 <@> leave[1 ref] vKP/REFC
EONT_EONT
PERL_ARGS_ASSERT_GV_MAGICALIZE;
if (stash != PL_defstash) { /* not the main stash */
- /* We only have to check for three names here: EXPORT, ISA
+ /* We only have to check for a few names here: a, b, EXPORT, ISA
and VERSION. All the others apply only to the main stash or to
CORE (which is checked right after this). */
- if (len > 2) {
+ if (len) {
const char * const name2 = name + 1;
switch (*name) {
case 'E':
if (strEQ(name2, "ERSION"))
GvMULTI_on(gv);
break;
+ case 'a':
+ case 'b':
+ if (len == 1 && sv_type == SVt_PV)
+ GvMULTI_on(gv);
+ /* FALL THROUGH */
default:
goto try_core;
}
SvREFCNT_dec(sv);
}
break;
+ case 'a':
+ case 'b':
+ if (len == 1 && sv_type == SVt_PV)
+ GvMULTI_on(gv);
}
}
########
-w
# warnable code, warnings enabled via command line switch
-$a =+ 3 ;
+$c =+ 3 ;
EXPECT
Reversed += operator at - line 3.
-Name "main::a" used only once: possible typo at - line 3.
+Name "main::c" used only once: possible typo at - line 3.
########
#! perl -w
# warnable code, warnings enabled via #! line
-$a =+ 3 ;
+$c =+ 3 ;
EXPECT
Reversed += operator at - line 3.
-Name "main::a" used only once: possible typo at - line 3.
+Name "main::c" used only once: possible typo at - line 3.
########
# warnable code, warnings enabled via compile time $^W
BEGIN { $^W = 1 }
-$a =+ 3 ;
+$c =+ 3 ;
EXPECT
Reversed += operator at - line 4.
-Name "main::a" used only once: possible typo at - line 4.
+Name "main::c" used only once: possible typo at - line 4.
########
-w
# warnable code, warnings enabled via command line switch