11 { my($a, undef, $c) = ("ok 9\n", "not ok 10\n", "ok 10\n");
12 ($x, $y) = ($a, $c); }
22 print &foo("ok 1\n","ok 2\n");
24 print $a,$b,$c,$d,$x,$y;
26 # same thing, only with arrays and associative arrays
33 { my($a,@c) = ("ok 19\n", "ok 20\n"); ($x, $y) = ($a, @c); }
43 print &foo2("ok 11\n","ok 12\n");
45 print $a,@b,@c,%d,$x,$y;
49 if (my $i = "inner") {
50 print "not " if $i ne "inner";
54 if ((my $i = 1) == 0) {
58 print "not" if $i != 1;
63 while (my $i = --$j) {
64 print("not "), last unless $i > 0;
67 print("not "), last unless $i > 0;
72 for (my $i = 0; (my $k = $i) < $j; ++$i) {
73 print("not "), last unless $i >= 0 && $i < $j && $i == $k;
76 print "not " if defined $k;
79 foreach my $i (26, 27) {
83 print "not " if $i ne "outer";
86 # Ensure that C<my @y> (without parens) doesn't force scalar context.
89 print +(@x ? "not " : ""), "ok 29\n";
91 print +(@x ? "not " : ""), "ok 30\n";
93 # Found in HTML::FormatPS
94 my %fonts = qw(nok 31);
95 for my $full (keys %fonts) {
97 # Supposed to be copy-on-write via force_normal after a THINKFIRST check.
98 print "$full $fonts{nok}\n";
101 # [perl #29340] optimising away the = () left the padav returning the
102 # array rather than the contents, leading to 'Bizarre copy of array' error
104 sub opta { my @a=() }
105 sub opth { my %h=() }
106 eval { my $x = opta };
109 eval { my $x = opth };
116 print "not " if defined $x->{bar};
119 eval { foo3(); foo3(); };
123 # my $foo = undef should always assign [perl #37776]
128 print "not " if defined $test;
131 goto loop if ++$count < 37;