pp_hot.c AOK Filehandle %s never opened $f = $a = "abc" ; print $f $a Filehandle %s opened only for input print STDIN "abc" ; Filehandle %s opened only for output print ; print on closed filehandle %s close STDIN ; print STDIN "abc" ; uninitialized my $a = undef ; my @b = @$a uninitialized my $a = undef ; my %b = %$a Odd number of elements in hash list %X = (1,2,3) ; Reference found where even-sized list expected $X = [ 1 ..3 ]; Read on closed filehandle %s close STDIN ; $a = ; Deep recursion on subroutine \"%s\" sub fred { fred() if $a++ < 200} fred() Deep recursion on anonymous subroutine $a = sub { &$a if $a++ < 200} &$a __END__ # pp_hot.c use warnings 'unopened' ; $f = $a = "abc" ; print $f $a; no warnings 'unopened' ; print $f $a; EXPECT Filehandle main::abc never opened at - line 4. ######## # pp_hot.c use warnings 'io' ; print STDIN "anc"; print ; print ; open(FOO, ">&STDOUT") and print ; print getc(STDERR); print getc(FOO); #################################################################### # The next test is known to fail on some systems (Linux/BSD+glibc, # # NeXT among others. glibc should be fixed in the next version, # # but it appears other platforms have little hope. We skip it for # # now (on the grounds that it is "just" a warning). # #################################################################### #read(FOO,$_,1); no warnings 'io' ; print STDIN "anc"; EXPECT Filehandle main::STDIN opened only for input at - line 3. Filehandle main::STDOUT opened only for output at - line 4. Filehandle main::STDERR opened only for output at - line 5. Filehandle main::FOO opened only for output at - line 6. Filehandle main::STDERR opened only for output at - line 7. Filehandle main::FOO opened only for output at - line 8. ######## # pp_hot.c use warnings 'closed' ; close STDIN ; print STDIN "anc"; no warnings 'closed' ; print STDIN "anc"; EXPECT print on closed filehandle main::STDIN at - line 4. ######## # pp_hot.c use warnings 'uninitialized' ; my $a = undef ; my @b = @$a; no warnings 'uninitialized' ; my @c = @$a; EXPECT Use of uninitialized value at - line 4. ######## # pp_hot.c use warnings 'uninitialized' ; my $a = undef ; my %b = %$a; no warnings 'uninitialized' ; my %c = %$a; EXPECT Use of uninitialized value at - line 4. ######## # pp_hot.c use warnings 'unsafe' ; my %X ; %X = (1,2,3) ; no warnings 'unsafe' ; my %Y ; %Y = (1,2,3) ; EXPECT Odd number of elements in hash assignment at - line 3. ######## # pp_hot.c use warnings 'unsafe' ; my %X ; %X = [1 .. 3] ; no warnings 'unsafe' ; my %Y ; %Y = [1 .. 3] ; EXPECT Reference found where even-sized list expected at - line 3. ######## # pp_hot.c use warnings 'closed' ; close STDIN ; $a = ; no warnings 'closed' ; $a = ; EXPECT Read on closed filehandle main::STDIN at - line 3. ######## # pp_hot.c use warnings 'recursion' ; sub fred { fred() if $a++ < 200 } { local $SIG{__WARN__} = sub { die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/ }; fred(); } EXPECT ok ######## # pp_hot.c no warnings 'recursion' ; sub fred { fred() if $a++ < 200 } { local $SIG{__WARN__} = sub { die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/ }; fred(); } EXPECT ######## # pp_hot.c use warnings 'recursion' ; $b = sub { &$b if $a++ < 200 } ; &$b ; EXPECT Deep recursion on anonymous subroutine at - line 5. ######## # pp_hot.c no warnings 'recursion' ; $b = sub { &$b if $a++ < 200 } ; &$b ; EXPECT