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 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 print() on closed filehandle STDIN at - line 4.
105 print() on closed filehandle STDIN at - line 6.
106 (Are you trying to call print() on dirhandle STDIN?)
108 # pp_hot.c [pp_print]
109 # [ID 20020425.012] from Dave Steiner <steiner@bakerst.rutgers.edu>
110 # This goes segv on 5.7.3
111 use warnings 'closed' ;
112 my $fh = *STDOUT{IO};
113 close STDOUT or die "Can't close STDOUT";
114 print $fh "Shouldn't print anything, but shouldn't SEGV either\n";
116 print() on closed filehandle at - line 7.
118 # pp_hot.c [pp_print]
120 use warnings 'closed';
121 open my $fh1, "nonexistent";
123 open $fh2, "nonexistent";
125 open $bar::fh3, "nonexistent";
127 open bar::FH4, "nonexistent";
130 print() on closed filehandle $fh1 at - line 5.
131 print() on closed filehandle $fh2 at - line 7.
132 print() on closed filehandle $fh3 at - line 9.
133 print() on closed filehandle FH4 at - line 11.
135 # pp_hot.c [pp_rv2av]
136 use warnings 'uninitialized' ;
139 no warnings 'uninitialized' ;
142 Use of uninitialized value in array dereference at - line 4.
144 # pp_hot.c [pp_rv2hv]
145 use warnings 'uninitialized' ;
148 no warnings 'uninitialized' ;
151 Use of uninitialized value in hash dereference at - line 4.
153 # pp_hot.c [pp_aassign]
154 use warnings 'misc' ;
155 my %X ; %X = (1,2,3) ;
157 my %Y ; %Y = (1,2,3) ;
159 Odd number of elements in hash assignment at - line 3.
161 # pp_hot.c [pp_aassign]
162 use warnings 'misc' ;
163 my %X ; %X = [1 .. 3] ;
165 my %Y ; %Y = [1 .. 3] ;
167 Reference found where even-sized list expected at - line 3.
169 # pp_hot.c [Perl_do_readline]
170 use warnings 'closed' ;
171 close STDIN ; $a = <STDIN> ;
172 opendir STDIN, "." ; $a = <STDIN> ;
174 no warnings 'closed' ;
175 opendir STDIN, "." ; $a = <STDIN> ;
178 readline() on closed filehandle STDIN at - line 3.
179 readline() on closed filehandle STDIN at - line 4.
180 (Are you trying to call readline() on dirhandle STDIN?)
182 # pp_hot.c [Perl_do_readline]
184 my $file = "./xcv" ; unlink $file ;
185 open (FH, ">$file") or die $! ;
190 open(FOO, ">&FH") or die $! ;
197 close (FH) or die $! ;
198 close (FOO) or die $! ;
201 Filehandle FH opened only for output at - line 5.
202 Filehandle FOO opened only for output at - line 10.
203 Filehandle FOO opened only for output at - line 14.
204 Filehandle FH opened only for output at - line 15.
206 # pp_hot.c [Perl_sub_crush_depth]
207 use warnings 'recursion' ;
213 local $SIG{__WARN__} = sub {
214 die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
221 # pp_hot.c [Perl_sub_crush_depth]
222 no warnings 'recursion' ;
228 local $SIG{__WARN__} = sub {
229 die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
236 # pp_hot.c [Perl_sub_crush_depth]
237 use warnings 'recursion' ;
245 Deep recursion on anonymous subroutine at - line 5.
247 # pp_hot.c [Perl_sub_crush_depth]
248 no warnings 'recursion' ;
257 # pp_hot.c [pp_concat]
258 use warnings 'uninitialized';
261 a($x . "x"); # should warn once
262 a($x . $y); # should warn twice
263 $x .= $y; # should warn once
264 $y .= $y; # should warn once
266 Use of uninitialized value in concatenation (.) or string at - line 5.
267 Use of uninitialized value in concatenation (.) or string at - line 6.
268 Use of uninitialized value in concatenation (.) or string at - line 6.
269 Use of uninitialized value in concatenation (.) or string at - line 7.
270 Use of uninitialized value in concatenation (.) or string at - line 8.
272 # pp_hot.c [pp_concat]
276 unless ($Config{ccflags} =~ /Y2KWARN/) {
277 print "SKIPPED\n# perl not built with -DPERL_Y2KWARN";
284 $x = "19" . $yy . "\n";
286 $x = "319" . $yy . "\n";
293 $x = "19" . $yy . "\n";
295 Possible Y2K bug: about to append an integer to '19' at - line 12.
296 Possible Y2K bug: about to append an integer to '19' at - line 13.
298 # pp_hot.c [pp_aelem]
310 Use of reference ".*" as array index at - line 4.
312 # pp_hot.c [pp_aelem]
313 package Foo;use overload q("") => sub {};package main;$a = bless {}, "Foo";
328 Use of reference ".*" as array index at - line 7.