Commit | Line | Data |
599cee73 |
1 | pp_hot.c AOK |
2 | |
3 | Filehandle %s never opened |
4 | $f = $a = "abc" ; print $f $a |
5 | |
6 | Filehandle %s opened only for input |
7 | print STDIN "abc" ; |
8 | |
af8c498a |
9 | Filehandle %s opened only for output |
10 | print <STDOUT> ; |
599cee73 |
11 | |
12 | print on closed filehandle %s |
13 | close STDIN ; print STDIN "abc" ; |
14 | |
15 | uninitialized |
16 | my $a = undef ; my @b = @$a |
17 | |
18 | uninitialized |
19 | my $a = undef ; my %b = %$a |
20 | |
21 | Odd number of elements in hash list |
22 | %X = (1,2,3) ; |
23 | |
24 | Reference found where even-sized list expected |
25 | $X = [ 1 ..3 ]; |
26 | |
af8c498a |
27 | Read on closed filehandle %s |
599cee73 |
28 | close STDIN ; $a = <STDIN>; |
29 | |
30 | Deep recursion on subroutine \"%s\" |
31 | sub fred { fred() if $a++ < 200} fred() |
32 | |
33 | Deep recursion on anonymous subroutine |
34 | $a = sub { &$a if $a++ < 200} &$a |
35 | |
36 | __END__ |
37 | # pp_hot.c |
38 | use warning 'unopened' ; |
39 | $f = $a = "abc" ; |
0453d815 |
40 | print $f $a; |
41 | no warning 'unopened' ; |
42 | print $f $a; |
599cee73 |
43 | EXPECT |
44 | Filehandle main::abc never opened at - line 4. |
45 | ######## |
46 | # pp_hot.c |
47 | use warning 'io' ; |
48 | print STDIN "anc"; |
af8c498a |
49 | print <STDOUT>; |
50 | print <STDERR>; |
51 | open(FOO, ">&STDOUT") and print <FOO>; |
52 | print getc(STDERR); |
53 | print getc(FOO); |
54 | read(FOO,$_,1); |
0453d815 |
55 | no warning 'io' ; |
56 | print STDIN "anc"; |
88c07c36 |
57 | #################################################################### |
58 | # N O T E # |
59 | # This test is known to fail on Linux and *BSD systems with glibc. # |
60 | # The glibc development team is aware of the problem, and has # |
61 | # determined a fix for the next release of that library. # |
62 | #################################################################### |
599cee73 |
63 | EXPECT |
64 | Filehandle main::STDIN opened only for input at - line 3. |
af8c498a |
65 | Filehandle main::STDOUT opened only for output at - line 4. |
66 | Filehandle main::STDERR opened only for output at - line 5. |
67 | Filehandle main::FOO opened only for output at - line 6. |
68 | Filehandle main::STDERR opened only for output at - line 7. |
69 | Filehandle main::FOO opened only for output at - line 8. |
70 | Filehandle main::FOO opened only for output at - line 9. |
599cee73 |
71 | ######## |
72 | # pp_hot.c |
73 | use warning 'closed' ; |
74 | close STDIN ; |
75 | print STDIN "anc"; |
0453d815 |
76 | no warning 'closed' ; |
77 | print STDIN "anc"; |
599cee73 |
78 | EXPECT |
79 | print on closed filehandle main::STDIN at - line 4. |
80 | ######## |
81 | # pp_hot.c |
82 | use warning 'uninitialized' ; |
83 | my $a = undef ; |
0453d815 |
84 | my @b = @$a; |
85 | no warning 'uninitialized' ; |
86 | my @c = @$a; |
599cee73 |
87 | EXPECT |
88 | Use of uninitialized value at - line 4. |
89 | ######## |
90 | # pp_hot.c |
91 | use warning 'uninitialized' ; |
92 | my $a = undef ; |
0453d815 |
93 | my %b = %$a; |
94 | no warning 'uninitialized' ; |
95 | my %c = %$a; |
599cee73 |
96 | EXPECT |
97 | Use of uninitialized value at - line 4. |
98 | ######## |
99 | # pp_hot.c |
100 | use warning 'unsafe' ; |
101 | my %X ; %X = (1,2,3) ; |
0453d815 |
102 | no warning 'unsafe' ; |
103 | my %Y ; %Y = (1,2,3) ; |
599cee73 |
104 | EXPECT |
105 | Odd number of elements in hash assignment at - line 3. |
106 | ######## |
107 | # pp_hot.c |
108 | use warning 'unsafe' ; |
109 | my %X ; %X = [1 .. 3] ; |
0453d815 |
110 | no warning 'unsafe' ; |
111 | my %Y ; %Y = [1 .. 3] ; |
599cee73 |
112 | EXPECT |
113 | Reference found where even-sized list expected at - line 3. |
114 | ######## |
115 | # pp_hot.c |
116 | use warning 'closed' ; |
117 | close STDIN ; $a = <STDIN> ; |
0453d815 |
118 | no warning 'closed' ; |
119 | $a = <STDIN> ; |
599cee73 |
120 | EXPECT |
af8c498a |
121 | Read on closed filehandle main::STDIN at - line 3. |
599cee73 |
122 | ######## |
123 | # pp_hot.c |
124 | use warning 'recursion' ; |
125 | sub fred |
126 | { |
127 | fred() if $a++ < 200 |
128 | } |
4a925ff6 |
129 | { |
130 | local $SIG{__WARN__} = sub { |
131 | die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/ |
132 | }; |
133 | fred(); |
134 | } |
599cee73 |
135 | EXPECT |
4a925ff6 |
136 | ok |
599cee73 |
137 | ######## |
138 | # pp_hot.c |
0453d815 |
139 | no warning 'recursion' ; |
140 | sub fred |
141 | { |
142 | fred() if $a++ < 200 |
143 | } |
144 | { |
145 | local $SIG{__WARN__} = sub { |
146 | die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/ |
147 | }; |
148 | fred(); |
149 | } |
150 | EXPECT |
151 | |
152 | ######## |
153 | # pp_hot.c |
599cee73 |
154 | use warning 'recursion' ; |
155 | $b = sub |
156 | { |
157 | &$b if $a++ < 200 |
158 | } ; |
159 | |
160 | &$b ; |
161 | EXPECT |
162 | Deep recursion on anonymous subroutine at - line 5. |
0453d815 |
163 | ######## |
164 | # pp_hot.c |
165 | no warning 'recursion' ; |
166 | $b = sub |
167 | { |
168 | &$b if $a++ < 200 |
169 | } ; |
170 | |
171 | &$b ; |
172 | EXPECT |
173 | |