The "used only once" warnings (from gv_check) come
[p5sagit/p5-mst-13.2.git] / t / lib / warnings / perl
CommitLineData
599cee73 1 perl.c AOK
2
3 gv_check(defstash)
4 Name \"%s::%s\" used only once: possible typo
5
0453d815 6 Mandatory Warnings All TODO
7 ------------------
8 Recompile perl with -DDEBUGGING to use -D switch [moreswitches]
9 Unbalanced scopes: %ld more ENTERs than LEAVEs [perl_destruct]
10 Unbalanced saves: %ld more saves than restores [perl_destruct]
11 Unbalanced tmps: %ld more allocs than frees [perl_destruct]
12 Unbalanced context: %ld more PUSHes than POPs [perl_destruct]
13 Unbalanced string table refcount: (%d) for \"%s\" [perl_destruct]
14 Scalars leaked: %ld [perl_destruct]
15
599cee73 16
17__END__
18# perl.c
4438c4b7 19no warnings 'once' ;
0453d815 20$x = 3 ;
4438c4b7 21use warnings 'once' ;
0453d815 22$z = 3 ;
23EXPECT
24Name "main::z" used only once: possible typo at - line 5.
25########
26-w
27# perl.c
599cee73 28$x = 3 ;
4438c4b7 29no warnings 'once' ;
0453d815 30$z = 3
599cee73 31EXPECT
32Name "main::x" used only once: possible typo at - line 3.
0453d815 33########
34# perl.c
35BEGIN { $^W =1 ; }
36$x = 3 ;
4438c4b7 37no warnings 'once' ;
0453d815 38$z = 3
39EXPECT
40Name "main::x" used only once: possible typo at - line 3.
41########
42-W
43# perl.c
4438c4b7 44no warnings 'once' ;
0453d815 45$x = 3 ;
4438c4b7 46use warnings 'once' ;
0453d815 47$z = 3 ;
48EXPECT
247c8d76 49OPTION random
0453d815 50Name "main::z" used only once: possible typo at - line 6.
a6fe520e 51Name "main::x" used only once: possible typo at - line 4.
0453d815 52########
53-X
54# perl.c
4438c4b7 55use warnings 'once' ;
0453d815 56$x = 3 ;
57EXPECT
7272584d 58########
0453d815 59
7272584d 60# perl.c
61{ use warnings 'once' ; $x = 3 ; }
62$y = 3 ;
63EXPECT
64Name "main::x" used only once: possible typo at - line 3.
65########
66
67# perl.c
68$z = 3 ;
69BEGIN { $^W = 1 }
70{ no warnings 'once' ; $x = 3 ; }
71$y = 3 ;
72EXPECT
73Name "main::y" used only once: possible typo at - line 6.