autoquote barewords followed by newline and arrow properly
[p5sagit/p5-mst-13.2.git] / t / pragma / warn / pp
CommitLineData
599cee73 1 pp.c TODO
2
3 substr outside of string
e476b1b5 4 $a = "ab" ; $b = substr($a, 4,5) ;
599cee73 5
6 Attempt to use reference as lvalue in substr
7 $a = "ab" ; $b = \$a ; substr($b, 1,1) = $b
8
9 uninitialized in pp_rv2gv()
10 my *b = *{ undef()}
11
12 uninitialized in pp_rv2sv()
13 my $a = undef ; my $b = $$a
14
15 Odd number of elements in hash list
16 my $a = { 1,2,3 } ;
17
18 Invalid type in unpack: '%c
19 my $A = pack ("A,A", 1,2) ;
20 my @A = unpack ("A,A", "22") ;
21
22 Attempt to pack pointer to temporary value
23 pack("p", "abc") ;
24
25 Explicit blessing to '' (assuming package main)
26 bless \[], "";
27
0453d815 28 Constant subroutine %s undefined <<<TODO
29 Constant subroutine (anonymous) undefined <<<TODO
30
599cee73 31__END__
32# pp.c
4438c4b7 33use warnings 'substr' ;
599cee73 34$a = "ab" ;
e476b1b5 35$b = substr($a, 4,5) ;
4438c4b7 36no warnings 'substr' ;
0453d815 37$a = "ab" ;
e476b1b5 38$b = substr($a, 4,5) ;
599cee73 39EXPECT
40substr outside of string at - line 4.
41########
42# pp.c
4438c4b7 43use warnings 'substr' ;
599cee73 44$a = "ab" ;
45$b = \$a ;
46substr($b, 1,1) = "ab" ;
4438c4b7 47no warnings 'substr' ;
0453d815 48substr($b, 1,1) = "ab" ;
599cee73 49EXPECT
50Attempt to use reference as lvalue in substr at - line 5.
51########
52# pp.c
4438c4b7 53use warnings 'uninitialized' ;
599cee73 54# TODO
55EXPECT
56
57########
58# pp.c
e476b1b5 59use warnings 'misc' ;
599cee73 60my $a = { 1,2,3};
e476b1b5 61no warnings 'misc' ;
0453d815 62my $b = { 1,2,3};
599cee73 63EXPECT
64Odd number of elements in hash assignment at - line 3.
65########
66# pp.c
e476b1b5 67use warnings 'pack' ;
68use warnings 'unpack' ;
599cee73 69my @a = unpack ("A,A", "22") ;
70my $a = pack ("A,A", 1,2) ;
e476b1b5 71no warnings 'pack' ;
72no warnings 'unpack' ;
0453d815 73my @b = unpack ("A,A", "22") ;
74my $b = pack ("A,A", 1,2) ;
599cee73 75EXPECT
e476b1b5 76Invalid type in unpack: ',' at - line 4.
77Invalid type in pack: ',' at - line 5.
599cee73 78########
79# pp.c
4438c4b7 80use warnings 'uninitialized' ;
599cee73 81my $a = undef ;
0453d815 82my $b = $$a;
4438c4b7 83no warnings 'uninitialized' ;
0453d815 84my $c = $$a;
599cee73 85EXPECT
b89fed5f 86Use of uninitialized value in scalar dereference at - line 4.
599cee73 87########
88# pp.c
e476b1b5 89use warnings 'pack' ;
599cee73 90sub foo { my $a = "a"; return $a . $a++ . $a++ }
91my $a = pack("p", &foo) ;
e476b1b5 92no warnings 'pack' ;
0453d815 93my $b = pack("p", &foo) ;
599cee73 94EXPECT
95Attempt to pack pointer to temporary value at - line 4.
96########
97# pp.c
e476b1b5 98use warnings 'misc' ;
599cee73 99bless \[], "" ;
e476b1b5 100no warnings 'misc' ;
0453d815 101bless \[], "" ;
599cee73 102EXPECT
103Explicit blessing to '' (assuming package main) at - line 3.
0453d815 104########
105# pp.c
106use utf8 ;
107$_ = "\x80 \xff" ;
108reverse ;
109EXPECT
0453d815 110########