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.
65 # There is no guarantee that STDOUT is output only, or STDIN input only.
66 # Certainly on some BSDs (at least FreeBSD, Darwin, BSDi) file descriptors
67 # 1 and 2 are opened read/write on the tty, and the IO layers may reflect this.
68 # So we must make our own file handle that is read only.
69 my $file = "./xcv" ; unlink $file ;
70 open (FH, ">$file") or die $! ;
72 die "There is no file $file" unless -f $file ;
73 open (FH, "<$file") or die $! ;
75 open(FOO, "<&FH") or die $! ;
83 close (FH) or die $! ;
84 close (FOO) or die $! ;
87 Filehandle FH opened only for input at - line 12.
88 Filehandle FOO opened only for input at - line 14.
89 Filehandle FH opened only for input at - line 19.
90 Filehandle FOO opened only for input at - line 20.
93 use warnings 'closed' ;
99 no warnings 'closed' ;
104 no warnings 'closed' ;
107 print() on closed filehandle STDIN at - line 4.
108 print() on closed filehandle STDIN at - line 6.
109 (Are you trying to call print() on dirhandle STDIN?)
111 # pp_hot.c [pp_print]
112 # [ID 20020425.012] from Dave Steiner <steiner@bakerst.rutgers.edu>
113 # This goes segv on 5.7.3
114 use warnings 'closed' ;
115 my $fh = *STDOUT{IO};
116 close STDOUT or die "Can't close STDOUT";
117 print $fh "Shouldn't print anything, but shouldn't SEGV either\n";
119 print() on closed filehandle at - line 7.
121 # pp_hot.c [pp_print]
123 use warnings 'closed';
124 open my $fh1, "nonexistent";
126 open $fh2, "nonexistent";
128 open $bar::fh3, "nonexistent";
130 open bar::FH4, "nonexistent";
133 print() on closed filehandle $fh1 at - line 5.
134 print() on closed filehandle $fh2 at - line 7.
135 print() on closed filehandle $fh3 at - line 9.
136 print() on closed filehandle FH4 at - line 11.
138 # pp_hot.c [pp_rv2av]
139 use warnings 'uninitialized' ;
142 no warnings 'uninitialized' ;
145 Use of uninitialized value $a in array dereference at - line 4.
147 # pp_hot.c [pp_rv2hv]
148 use warnings 'uninitialized' ;
151 no warnings 'uninitialized' ;
154 Use of uninitialized value $a in hash dereference at - line 4.
156 # pp_hot.c [pp_aassign]
157 use warnings 'misc' ;
158 my %X ; %X = (1,2,3) ;
160 my %Y ; %Y = (1,2,3) ;
162 Odd number of elements in hash assignment at - line 3.
164 # pp_hot.c [pp_aassign]
165 use warnings 'misc' ;
166 my %X ; %X = [1 .. 3] ;
168 my %Y ; %Y = [1 .. 3] ;
170 Reference found where even-sized list expected at - line 3.
172 # pp_hot.c [Perl_do_readline]
173 use warnings 'closed' ;
174 close STDIN ; $a = <STDIN> ;
175 opendir STDIN, "." ; $a = <STDIN> ;
177 no warnings 'closed' ;
178 opendir STDIN, "." ; $a = <STDIN> ;
181 readline() on closed filehandle STDIN at - line 3.
182 readline() on closed filehandle STDIN at - line 4.
183 (Are you trying to call readline() on dirhandle STDIN?)
185 # pp_hot.c [Perl_do_readline]
187 my $file = "./xcv" ; unlink $file ;
188 open (FH, ">$file") or die $! ;
193 open(FOO, ">&FH") or die $! ;
200 close (FH) or die $! ;
201 close (FOO) or die $! ;
204 Filehandle FH opened only for output at - line 5.
205 Filehandle FOO opened only for output at - line 10.
206 Filehandle FOO opened only for output at - line 14.
207 Filehandle FH opened only for output at - line 15.
209 # pp_hot.c [Perl_sub_crush_depth]
210 use warnings 'recursion' ;
216 local $SIG{__WARN__} = sub {
217 die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
224 # pp_hot.c [Perl_sub_crush_depth]
225 no warnings 'recursion' ;
231 local $SIG{__WARN__} = sub {
232 die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
239 # pp_hot.c [Perl_sub_crush_depth]
240 use warnings 'recursion' ;
248 Deep recursion on anonymous subroutine at - line 5.
250 # pp_hot.c [Perl_sub_crush_depth]
251 no warnings 'recursion' ;
260 # pp_hot.c [pp_concat]
261 use warnings 'uninitialized';
264 a($x . "x"); # should warn once
265 a($x . $y); # should warn twice
266 $x .= $y; # should warn once
267 $y .= $y; # should warn once
269 Use of uninitialized value $x in concatenation (.) or string at - line 5.
270 Use of uninitialized value $y in concatenation (.) or string at - line 6.
271 Use of uninitialized value $x in concatenation (.) or string at - line 6.
272 Use of uninitialized value $y in concatenation (.) or string at - line 7.
273 Use of uninitialized value $y in concatenation (.) or string at - line 8.
275 # pp_hot.c [pp_aelem]
287 Use of reference ".*" as array index at - line 4.
289 # pp_hot.c [pp_aelem]
290 package Foo;use overload q("") => sub {};package main;$a = bless {}, "Foo";
305 Use of reference ".*" as array index at - line 7.