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 Possible Y2K bug: about to append an integer to '19' [pp_concat]
50 Use of reference "%s" as array index [pp_aelem]
55 use warnings 'unopened' ;
58 no warnings 'unopened' ;
61 no warnings 'unopened' ;
64 print() on unopened filehandle abc at - line 4.
68 # There is no guarantee that STDOUT is output only, or STDIN input only.
69 # Certainly on some BSDs (at least FreeBSD, Darwin, BSDi) file descriptors
70 # 1 and 2 are opened read/write on the tty, and the IO layers may reflect this.
71 # So we must make our own file handle that is read only.
72 my $file = "./xcv" ; unlink $file ;
73 open (FH, ">$file") or die $! ;
75 die "There is no file $file" unless -f $file ;
76 open (FH, "<$file") or die $! ;
78 open(FOO, "<&FH") or die $! ;
86 close (FH) or die $! ;
87 close (FOO) or die $! ;
90 Filehandle FH opened only for input at - line 12.
91 Filehandle FOO opened only for input at - line 14.
92 Filehandle FH opened only for input at - line 19.
93 Filehandle FOO opened only for input at - line 20.
96 use warnings 'closed' ;
102 no warnings 'closed' ;
107 no warnings 'closed' ;
110 print() on closed filehandle STDIN at - line 4.
111 print() on closed filehandle STDIN at - line 6.
112 (Are you trying to call print() on dirhandle STDIN?)
114 # pp_hot.c [pp_print]
115 # [ID 20020425.012] from Dave Steiner <steiner@bakerst.rutgers.edu>
116 # This goes segv on 5.7.3
117 use warnings 'closed' ;
118 my $fh = *STDOUT{IO};
119 close STDOUT or die "Can't close STDOUT";
120 print $fh "Shouldn't print anything, but shouldn't SEGV either\n";
122 print() on closed filehandle at - line 7.
124 # pp_hot.c [pp_print]
126 use warnings 'closed';
127 open my $fh1, "nonexistent";
129 open $fh2, "nonexistent";
131 open $bar::fh3, "nonexistent";
133 open bar::FH4, "nonexistent";
136 print() on closed filehandle $fh1 at - line 5.
137 print() on closed filehandle $fh2 at - line 7.
138 print() on closed filehandle $fh3 at - line 9.
139 print() on closed filehandle FH4 at - line 11.
141 # pp_hot.c [pp_rv2av]
142 use warnings 'uninitialized' ;
145 no warnings 'uninitialized' ;
148 Use of uninitialized value in array dereference at - line 4.
150 # pp_hot.c [pp_rv2hv]
151 use warnings 'uninitialized' ;
154 no warnings 'uninitialized' ;
157 Use of uninitialized value in hash dereference at - line 4.
159 # pp_hot.c [pp_aassign]
160 use warnings 'misc' ;
161 my %X ; %X = (1,2,3) ;
163 my %Y ; %Y = (1,2,3) ;
165 Odd number of elements in hash assignment at - line 3.
167 # pp_hot.c [pp_aassign]
168 use warnings 'misc' ;
169 my %X ; %X = [1 .. 3] ;
171 my %Y ; %Y = [1 .. 3] ;
173 Reference found where even-sized list expected at - line 3.
175 # pp_hot.c [Perl_do_readline]
176 use warnings 'closed' ;
177 close STDIN ; $a = <STDIN> ;
178 opendir STDIN, "." ; $a = <STDIN> ;
180 no warnings 'closed' ;
181 opendir STDIN, "." ; $a = <STDIN> ;
184 readline() on closed filehandle STDIN at - line 3.
185 readline() on closed filehandle STDIN at - line 4.
186 (Are you trying to call readline() on dirhandle STDIN?)
188 # pp_hot.c [Perl_do_readline]
190 my $file = "./xcv" ; unlink $file ;
191 open (FH, ">$file") or die $! ;
196 open(FOO, ">&FH") or die $! ;
203 close (FH) or die $! ;
204 close (FOO) or die $! ;
207 Filehandle FH opened only for output at - line 5.
208 Filehandle FOO opened only for output at - line 10.
209 Filehandle FOO opened only for output at - line 14.
210 Filehandle FH opened only for output at - line 15.
212 # pp_hot.c [Perl_sub_crush_depth]
213 use warnings 'recursion' ;
219 local $SIG{__WARN__} = sub {
220 die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
227 # pp_hot.c [Perl_sub_crush_depth]
228 no warnings 'recursion' ;
234 local $SIG{__WARN__} = sub {
235 die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
242 # pp_hot.c [Perl_sub_crush_depth]
243 use warnings 'recursion' ;
251 Deep recursion on anonymous subroutine at - line 5.
253 # pp_hot.c [Perl_sub_crush_depth]
254 no warnings 'recursion' ;
263 # pp_hot.c [pp_concat]
264 use warnings 'uninitialized';
267 a($x . "x"); # should warn once
268 a($x . $y); # should warn twice
269 $x .= $y; # should warn once
270 $y .= $y; # should warn once
272 Use of uninitialized value in concatenation (.) or string at - line 5.
273 Use of uninitialized value in concatenation (.) or string at - line 6.
274 Use of uninitialized value in concatenation (.) or string at - line 6.
275 Use of uninitialized value in concatenation (.) or string at - line 7.
276 Use of uninitialized value in concatenation (.) or string at - line 8.
278 # pp_hot.c [pp_concat]
282 unless ($Config{ccflags} =~ /Y2KWARN/) {
283 print "SKIPPED\n# perl not built with -DPERL_Y2KWARN";
290 $x = "19" . $yy . "\n";
292 $x = "319" . $yy . "\n";
299 $x = "19" . $yy . "\n";
301 Possible Y2K bug: about to append an integer to '19' at - line 12.
302 Possible Y2K bug: about to append an integer to '19' at - line 13.
304 # pp_hot.c [pp_aelem]
316 Use of reference ".*" as array index at - line 4.
318 # pp_hot.c [pp_aelem]
319 package Foo;use overload q("") => sub {};package main;$a = bless {}, "Foo";
334 Use of reference ".*" as array index at - line 7.