3 print() on unopened filehandle abc [pp_print]
4 $f = $a = "abc" ; print $f $a
6 Filehandle %s opened only for input [pp_print]
9 Filehandle %s opened only for output [pp_print]
12 print() on closed filehandle %s [pp_print]
13 close STDIN ; print STDIN "abc" ;
15 uninitialized [pp_rv2av]
16 my $a = undef ; my @b = @$a
18 uninitialized [pp_rv2hv]
19 my $a = undef ; my %b = %$a
21 Odd number of elements in hash list [pp_aassign]
24 Reference found where even-sized list expected [pp_aassign]
27 Filehandle %s opened only for output [Perl_do_readline]
31 glob failed (can't start child: %s) [Perl_do_readline] <<TODO
33 readline() on closed filehandle %s [Perl_do_readline]
34 close STDIN ; $a = <STDIN>;
36 readline() on closed filehandle %s [Perl_do_readline]
39 glob failed (child exited with status %d%s) [Perl_do_readline] <<TODO
41 Deep recursion on subroutine \"%s\" [Perl_sub_crush_depth]
42 sub fred { fred() if $a++ < 200} fred()
44 Deep recursion on anonymous subroutine [Perl_sub_crush_depth]
45 $a = sub { &$a if $a++ < 200} &$a
47 Use of reference "%s" as array index [pp_aelem]
52 use warnings 'unopened' ;
55 no warnings 'unopened' ;
58 no warnings 'unopened' ;
61 print() on unopened filehandle abc at - line 4.
64 use warnings 'unopened' ;
65 $SIG{__WARN__} = sub { warn $_[0] =~ s/\0/\\0/rug; };
69 print() on unopened filehandle a\0b at - line 4.
70 print() on unopened filehandle \0b at - line 5.
74 # There is no guarantee that STDOUT is output only, or STDIN input only.
75 # Certainly on some BSDs (at least FreeBSD, Darwin, BSDi) file descriptors
76 # 1 and 2 are opened read/write on the tty, and the IO layers may reflect this.
77 # So we must make our own file handle that is read only.
78 my $file = "./xcv" ; unlink $file ;
79 open (FH, ">$file") or die $! ;
81 die "There is no file $file" unless -f $file ;
82 open (FH, "<$file") or die $! ;
84 open(FOO, "<&FH") or die $! ;
92 close (FH) or die $! ;
93 close (FOO) or die $! ;
96 Filehandle FH opened only for input at - line 12.
97 Filehandle FOO opened only for input at - line 14.
98 Filehandle FH opened only for input at - line 19.
99 Filehandle FOO opened only for input at - line 20.
101 # pp_hot.c [pp_print]
102 $SIG{__WARN__} = sub { warn $_[0] =~ s/\0/\\0/rug; };
104 my $file = "./xcv" ; unlink $file ;
105 open (FH, ">$file") or die $! ;
107 die "There is no file $file" unless -f $file ;
108 open ("a\0b", "<$file") or die $! ;
109 print {"a\0b"} "anc" ;
110 open ("\0b", "<$file") or die $! ;
111 print {"\0b"} "anc" ;
112 close "a\0b" or die $! ;
113 close "\0b" or die $! ;
116 Filehandle a\0b opened only for input at - line 9.
117 Filehandle \0b opened only for input at - line 11.
119 # pp_hot.c [pp_print]
120 use warnings 'closed' ;
126 no warnings 'closed' ;
131 no warnings 'closed' ;
134 print() on closed filehandle STDIN at - line 4.
135 print() on closed filehandle STDIN at - line 6.
136 (Are you trying to call print() on dirhandle STDIN?)
138 # pp_hot.c [pp_print]
139 # [ID 20020425.012] from Dave Steiner <steiner@bakerst.rutgers.edu>
140 # This goes segv on 5.7.3
141 use warnings 'closed' ;
142 my $fh = *STDOUT{IO};
143 close STDOUT or die "Can't close STDOUT";
144 print $fh "Shouldn't print anything, but shouldn't SEGV either\n";
146 print() on closed filehandle __ANONIO__ at - line 7.
148 # pp_hot.c [pp_print]
150 use warnings 'closed';
151 open my $fh1, "nonexistent";
153 open $fh2, "nonexistent";
155 open $bar::fh3, "nonexistent";
157 open bar::FH4, "nonexistent";
160 print() on closed filehandle $fh1 at - line 5.
161 print() on closed filehandle $fh2 at - line 7.
162 print() on closed filehandle $fh3 at - line 9.
163 print() on closed filehandle FH4 at - line 11.
165 # pp_hot.c [pp_rv2av]
166 use warnings 'uninitialized' ;
169 no warnings 'uninitialized' ;
172 Use of uninitialized value $a in array dereference at - line 4.
174 # pp_hot.c [pp_rv2hv]
175 use warnings 'uninitialized' ;
178 no warnings 'uninitialized' ;
181 Use of uninitialized value $a in hash dereference at - line 4.
183 # pp_hot.c [pp_aassign]
184 use warnings 'misc' ;
185 my %X ; %X = (1,2,3) ;
187 my %Y ; %Y = (1,2,3) ;
189 Odd number of elements in hash assignment at - line 3.
191 # pp_hot.c [pp_aassign]
192 use warnings 'misc' ;
193 my %X ; %X = [1 .. 3] ;
195 my %Y ; %Y = [1 .. 3] ;
197 Reference found where even-sized list expected at - line 3.
199 # pp_hot.c [Perl_do_readline]
200 use warnings 'closed' ;
201 close STDIN ; $a = <STDIN> ;
202 opendir STDIN, "." ; $a = <STDIN> ;
204 no warnings 'closed' ;
205 opendir STDIN, "." ; $a = <STDIN> ;
208 readline() on closed filehandle STDIN at - line 3.
209 readline() on closed filehandle STDIN at - line 4.
210 (Are you trying to call readline() on dirhandle STDIN?)
212 # pp_hot.c [Perl_do_readline]
213 use warnings 'closed' ;
214 close STDIN ; $a .= <STDIN> ;
215 opendir STDIN, "." ; $a .= <STDIN> ;
217 no warnings 'closed' ;
218 opendir STDIN, "." ; $a .= <STDIN> ;
221 readline() on closed filehandle STDIN at - line 3.
222 readline() on closed filehandle STDIN at - line 4.
223 (Are you trying to call readline() on dirhandle STDIN?)
225 # pp_hot.c [Perl_do_readline]
227 my $file = "./xcv" ; unlink $file ;
228 open (FH, ">$file") or die $! ;
233 open(FOO, ">&FH") or die $! ;
240 close (FH) or die $! ;
241 close (FOO) or die $! ;
244 Filehandle FH opened only for output at - line 5.
245 Filehandle FOO opened only for output at - line 10.
246 Filehandle FOO opened only for output at - line 14.
247 Filehandle FH opened only for output at - line 15.
249 # pp_hot.c [Perl_sub_crush_depth]
250 use warnings 'recursion' ;
256 local $SIG{__WARN__} = sub {
257 die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
264 # pp_hot.c [Perl_sub_crush_depth]
265 no warnings 'recursion' ;
271 local $SIG{__WARN__} = sub {
272 die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
279 # pp_hot.c [Perl_sub_crush_depth]
280 use warnings 'recursion' ;
288 Deep recursion on anonymous subroutine at - line 5.
290 # pp_hot.c [Perl_sub_crush_depth]
291 no warnings 'recursion' ;
300 # pp_hot.c [pp_concat]
301 use warnings 'uninitialized';
304 a($x . "x"); # should warn once
305 a($x . $y); # should warn twice
306 $x .= $y; # should warn once
307 $y .= $y; # should warn once
309 Use of uninitialized value $x in concatenation (.) or string at - line 5.
310 Use of uninitialized value $x in concatenation (.) or string at - line 6.
311 Use of uninitialized value $y in concatenation (.) or string at - line 6.
312 Use of uninitialized value $y in concatenation (.) or string at - line 7.
313 Use of uninitialized value $y in concatenation (.) or string at - line 8.
315 # pp_hot.c [pp_aelem]
327 Use of reference ".*" as array index at - line 4.
329 # pp_hot.c [pp_aelem]
330 package Foo;use overload q("") => sub {};package main;$a = bless {}, "Foo";
345 Use of reference ".*" as array index at - line 7.
348 use constant FOO => { a => 1 };
354 use constant FOO => {};
359 Use of reference "HASH\(0x\w+\)" as array index at - line 3.