1N/A pp_hot.c
1N/A
1N/A print() on unopened filehandle abc [pp_print]
1N/A $f = $a = "abc" ; print $f $a
1N/A
1N/A Filehandle %s opened only for input [pp_print]
1N/A print STDIN "abc" ;
1N/A
1N/A Filehandle %s opened only for output [pp_print]
1N/A $a = <STDOUT> ;
1N/A
1N/A print() on closed filehandle %s [pp_print]
1N/A close STDIN ; print STDIN "abc" ;
1N/A
1N/A uninitialized [pp_rv2av]
1N/A my $a = undef ; my @b = @$a
1N/A
1N/A uninitialized [pp_rv2hv]
1N/A my $a = undef ; my %b = %$a
1N/A
1N/A Odd number of elements in hash list [pp_aassign]
1N/A %X = (1,2,3) ;
1N/A
1N/A Reference found where even-sized list expected [pp_aassign]
1N/A $X = [ 1 ..3 ];
1N/A
1N/A Filehandle %s opened only for output [Perl_do_readline]
1N/A open (FH, ">./xcv") ;
1N/A my $a = <FH> ;
1N/A
1N/A glob failed (can't start child: %s) [Perl_do_readline] <<TODO
1N/A
1N/A readline() on closed filehandle %s [Perl_do_readline]
1N/A close STDIN ; $a = <STDIN>;
1N/A
1N/A readline() on closed filehandle %s [Perl_do_readline]
1N/A readline(NONESUCH);
1N/A
1N/A glob failed (child exited with status %d%s) [Perl_do_readline] <<TODO
1N/A
1N/A Deep recursion on subroutine \"%s\" [Perl_sub_crush_depth]
1N/A sub fred { fred() if $a++ < 200} fred()
1N/A
1N/A Deep recursion on anonymous subroutine [Perl_sub_crush_depth]
1N/A $a = sub { &$a if $a++ < 200} &$a
1N/A
1N/A Possible Y2K bug: about to append an integer to '19' [pp_concat]
1N/A $x = "19$yy\n";
1N/A
1N/A Use of reference "%s" as array index [pp_aelem]
1N/A $x[\1]
1N/A
1N/A__END__
1N/A# pp_hot.c [pp_print]
1N/Ause warnings 'unopened' ;
1N/A$f = $a = "abc" ;
1N/Aprint $f $a;
1N/Ano warnings 'unopened' ;
1N/Aprint $f $a;
1N/Ause warnings;
1N/Ano warnings 'unopened' ;
1N/Aprint $f $a;
1N/AEXPECT
1N/Aprint() on unopened filehandle abc at - line 4.
1N/A########
1N/A# pp_hot.c [pp_print]
1N/Ause warnings 'io' ;
1N/A# There is no guarantee that STDOUT is output only, or STDIN input only.
1N/A# Certainly on some BSDs (at least FreeBSD, Darwin, BSDi) file descriptors
1N/A# 1 and 2 are opened read/write on the tty, and the IO layers may reflect this.
1N/A# So we must make our own file handle that is read only.
1N/Amy $file = "./xcv" ; unlink $file ;
1N/Aopen (FH, ">$file") or die $! ;
1N/Aclose FH or die $! ;
1N/Adie "There is no file $file" unless -f $file ;
1N/Aopen (FH, "<$file") or die $! ;
1N/Aprint FH "anc" ;
1N/Aopen(FOO, "<&FH") or die $! ;
1N/Aprint FOO "anc" ;
1N/Ano warnings 'io' ;
1N/Aprint FH "anc" ;
1N/Aprint FOO "anc" ;
1N/Ause warnings 'io' ;
1N/Aprint FH "anc" ;
1N/Aprint FOO "anc" ;
1N/Aclose (FH) or die $! ;
1N/Aclose (FOO) or die $! ;
1N/Aunlink $file ;
1N/AEXPECT
1N/AFilehandle FH opened only for input at - line 12.
1N/AFilehandle FOO opened only for input at - line 14.
1N/AFilehandle FH opened only for input at - line 19.
1N/AFilehandle FOO opened only for input at - line 20.
1N/A########
1N/A# pp_hot.c [pp_print]
1N/Ause warnings 'closed' ;
1N/Aclose STDIN ;
1N/Aprint STDIN "anc";
1N/Aopendir STDIN, ".";
1N/Aprint STDIN "anc";
1N/Aclosedir STDIN;
1N/Ano warnings 'closed' ;
1N/Aprint STDIN "anc";
1N/Aopendir STDIN, ".";
1N/Aprint STDIN "anc";
1N/Ause warnings;
1N/Ano warnings 'closed' ;
1N/Aprint STDIN "anc";
1N/AEXPECT
1N/Aprint() on closed filehandle STDIN at - line 4.
1N/Aprint() on closed filehandle STDIN at - line 6.
1N/A (Are you trying to call print() on dirhandle STDIN?)
1N/A########
1N/A# pp_hot.c [pp_print]
1N/A# [ID 20020425.012] from Dave Steiner <steiner@bakerst.rutgers.edu>
1N/A# This goes segv on 5.7.3
1N/Ause warnings 'closed' ;
1N/Amy $fh = *STDOUT{IO};
1N/Aclose STDOUT or die "Can't close STDOUT";
1N/Aprint $fh "Shouldn't print anything, but shouldn't SEGV either\n";
1N/AEXPECT
1N/Aprint() on closed filehandle at - line 7.
1N/A########
1N/A# pp_hot.c [pp_print]
1N/Apackage foo;
1N/Ause warnings 'closed';
1N/Aopen my $fh1, "nonexistent";
1N/Aprint $fh1 42;
1N/Aopen $fh2, "nonexistent";
1N/Aprint $fh2 42;
1N/Aopen $bar::fh3, "nonexistent";
1N/Aprint $bar::fh3 42;
1N/Aopen bar::FH4, "nonexistent";
1N/Aprint bar::FH4 42;
1N/AEXPECT
1N/Aprint() on closed filehandle $fh1 at - line 5.
1N/Aprint() on closed filehandle $fh2 at - line 7.
1N/Aprint() on closed filehandle $fh3 at - line 9.
1N/Aprint() on closed filehandle FH4 at - line 11.
1N/A########
1N/A# pp_hot.c [pp_rv2av]
1N/Ause warnings 'uninitialized' ;
1N/Amy $a = undef ;
1N/Amy @b = @$a;
1N/Ano warnings 'uninitialized' ;
1N/Amy @c = @$a;
1N/AEXPECT
1N/AUse of uninitialized value in array dereference at - line 4.
1N/A########
1N/A# pp_hot.c [pp_rv2hv]
1N/Ause warnings 'uninitialized' ;
1N/Amy $a = undef ;
1N/Amy %b = %$a;
1N/Ano warnings 'uninitialized' ;
1N/Amy %c = %$a;
1N/AEXPECT
1N/AUse of uninitialized value in hash dereference at - line 4.
1N/A########
1N/A# pp_hot.c [pp_aassign]
1N/Ause warnings 'misc' ;
1N/Amy %X ; %X = (1,2,3) ;
1N/Ano warnings 'misc' ;
1N/Amy %Y ; %Y = (1,2,3) ;
1N/AEXPECT
1N/AOdd number of elements in hash assignment at - line 3.
1N/A########
1N/A# pp_hot.c [pp_aassign]
1N/Ause warnings 'misc' ;
1N/Amy %X ; %X = [1 .. 3] ;
1N/Ano warnings 'misc' ;
1N/Amy %Y ; %Y = [1 .. 3] ;
1N/AEXPECT
1N/AReference found where even-sized list expected at - line 3.
1N/A########
1N/A# pp_hot.c [Perl_do_readline]
1N/Ause warnings 'closed' ;
1N/Aclose STDIN ; $a = <STDIN> ;
1N/Aopendir STDIN, "." ; $a = <STDIN> ;
1N/Aclosedir STDIN;
1N/Ano warnings 'closed' ;
1N/Aopendir STDIN, "." ; $a = <STDIN> ;
1N/A$a = <STDIN> ;
1N/AEXPECT
1N/Areadline() on closed filehandle STDIN at - line 3.
1N/Areadline() on closed filehandle STDIN at - line 4.
1N/A (Are you trying to call readline() on dirhandle STDIN?)
1N/A########
1N/A# pp_hot.c [Perl_do_readline]
1N/Ause warnings 'io' ;
1N/Amy $file = "./xcv" ; unlink $file ;
1N/Aopen (FH, ">$file") or die $! ;
1N/Amy $a = <FH> ;
1N/Ano warnings 'io' ;
1N/A$a = <FH> ;
1N/Ause warnings 'io' ;
1N/Aopen(FOO, ">&FH") or die $! ;
1N/A$a = <FOO> ;
1N/Ano warnings 'io' ;
1N/A$a = <FOO> ;
1N/Ause warnings 'io' ;
1N/A$a = <FOO> ;
1N/A$a = <FH> ;
1N/Aclose (FH) or die $! ;
1N/Aclose (FOO) or die $! ;
1N/Aunlink $file ;
1N/AEXPECT
1N/AFilehandle FH opened only for output at - line 5.
1N/AFilehandle FOO opened only for output at - line 10.
1N/AFilehandle FOO opened only for output at - line 14.
1N/AFilehandle FH opened only for output at - line 15.
1N/A########
1N/A# pp_hot.c [Perl_sub_crush_depth]
1N/Ause warnings 'recursion' ;
1N/Asub fred
1N/A{
1N/A fred() if $a++ < 200
1N/A}
1N/A{
1N/A local $SIG{__WARN__} = sub {
1N/A die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
1N/A };
1N/A fred();
1N/A}
1N/AEXPECT
1N/Aok
1N/A########
1N/A# pp_hot.c [Perl_sub_crush_depth]
1N/Ano warnings 'recursion' ;
1N/Asub fred
1N/A{
1N/A fred() if $a++ < 200
1N/A}
1N/A{
1N/A local $SIG{__WARN__} = sub {
1N/A die "ok\n" if $_[0] =~ /^Deep recursion on subroutine "main::fred"/
1N/A };
1N/A fred();
1N/A}
1N/AEXPECT
1N/A
1N/A########
1N/A# pp_hot.c [Perl_sub_crush_depth]
1N/Ause warnings 'recursion' ;
1N/A$b = sub
1N/A{
1N/A &$b if $a++ < 200
1N/A} ;
1N/A
1N/A&$b ;
1N/AEXPECT
1N/ADeep recursion on anonymous subroutine at - line 5.
1N/A########
1N/A# pp_hot.c [Perl_sub_crush_depth]
1N/Ano warnings 'recursion' ;
1N/A$b = sub
1N/A{
1N/A &$b if $a++ < 200
1N/A} ;
1N/A
1N/A&$b ;
1N/AEXPECT
1N/A########
1N/A# pp_hot.c [pp_concat]
1N/Ause warnings 'uninitialized';
1N/Amy($x, $y);
1N/Asub a { shift }
1N/Aa($x . "x"); # should warn once
1N/Aa($x . $y); # should warn twice
1N/A$x .= $y; # should warn once
1N/A$y .= $y; # should warn once
1N/AEXPECT
1N/AUse of uninitialized value in concatenation (.) or string at - line 5.
1N/AUse of uninitialized value in concatenation (.) or string at - line 6.
1N/AUse of uninitialized value in concatenation (.) or string at - line 6.
1N/AUse of uninitialized value in concatenation (.) or string at - line 7.
1N/AUse of uninitialized value in concatenation (.) or string at - line 8.
1N/A########
1N/A# pp_hot.c [pp_concat]
1N/Ause warnings 'y2k';
1N/Ause Config;
1N/ABEGIN {
1N/A unless ($Config{ccflags} =~ /Y2KWARN/) {
1N/A print "SKIPPED\n# perl not built with -DPERL_Y2KWARN";
1N/A exit 0;
1N/A }
1N/A}
1N/Amy $x;
1N/Amy $yy = 78;
1N/A$x = "19$yy\n";
1N/A$x = "19" . $yy . "\n";
1N/A$x = "319$yy\n";
1N/A$x = "319" . $yy . "\n";
1N/A$yy = 19;
1N/A$x = "ok $yy\n";
1N/A$yy = 9;
1N/A$x = 1 . $yy;
1N/Ano warnings 'y2k';
1N/A$x = "19$yy\n";
1N/A$x = "19" . $yy . "\n";
1N/AEXPECT
1N/APossible Y2K bug: about to append an integer to '19' at - line 12.
1N/APossible Y2K bug: about to append an integer to '19' at - line 13.
1N/A########
1N/A# pp_hot.c [pp_aelem]
1N/A{
1N/Ause warnings 'misc';
1N/Aprint $x[\1];
1N/A}
1N/A{
1N/Ano warnings 'misc';
1N/Aprint $x[\1];
1N/A}
1N/A
1N/AEXPECT
1N/AOPTION regex
1N/AUse of reference ".*" as array index at - line 4.
1N/A########
1N/A# pp_hot.c [pp_aelem]
1N/Apackage Foo;use overload q("") => sub {};package main;$a = bless {}, "Foo";
1N/A$b = {};
1N/A{
1N/Ause warnings 'misc';
1N/Aprint $x[$a];
1N/Aprint $x[$b];
1N/A}
1N/A{
1N/Ano warnings 'misc';
1N/Aprint $x[$a];
1N/Aprint $x[$b];
1N/A}
1N/A
1N/AEXPECT
1N/AOPTION regex
1N/AUse of reference ".*" as array index at - line 7.