| 1 |
#!/usr/bin/perl |
| 2 |
|
| 3 |
# Copyright 2002-2026, Paul Johnson ([email protected]) |
| 4 |
|
| 5 |
# This software is free. It is licensed under the same terms as Perl itself. |
| 6 |
|
| 7 |
# The latest version of this software should be available from my homepage: |
| 8 |
# https://pjcj.net |
| 9 |
|
| 10 |
# __COVER__ skip_test $^O eq "cygwin" |
| 11 |
# __COVER__ skip_reason Busted on cygwin |
| 12 |
|
| 13 |
use strict; |
| 14 |
use warnings; |
| 15 |
|
| 16 |
my @x; |
| 17 |
|
| 18 |
my $y = 1; |
| 19 |
my $z = 0; |
| 20 |
$::foo = 17; |
| 21 |
|
| 22 |
$ENV{PATH} = "/bin"; |
| 23 |
system "pwd"; |
| 24 |
use lib "tests"; |
| 25 |
my $file = "cond_or.pl"; |
| 26 |
unless (my $return = do $file) { |
| 27 |
die "couldn't parse $file: $@" if $@; |
| 28 |
die "couldn't do $file: $!" unless defined $return; |
| 29 |
die "couldn't run $file" unless $return; |
| 30 |
} |
| 31 |
|
| 32 |
for my $i (0 .. 10) { |
| 33 |
$y || |
| 34 |
$x[1]++; |
| 35 |
|
| 36 |
$y || |
| 37 |
$x[0]++ || |
| 38 |
$x[1]++; |
| 39 |
|
| 40 |
$x[2]++ |
| 41 |
unless $z; |
| 42 |
|
| 43 |
for (0 .. 2) { |
| 44 |
$x[3]++; |
| 45 |
} |
| 46 |
|
| 47 |
if ($z) { |
| 48 |
$x[4]++; |
| 49 |
} else { |
| 50 |
$x[5]++; |
| 51 |
} |
| 52 |
|
| 53 |
my $p = $y || $z; |
| 54 |
my $q = $z || $y; |
| 55 |
my $r = $i || "qqq"; |
| 56 |
my $s = $i || []; |
| 57 |
my $t = $y | $z; |
| 58 |
my $u = $y || 0; |
| 59 |
my $v = $y || undef; |
| 60 |
my $w = $z || 0; |
| 61 |
|
| 62 |
$p ||= $y; |
| 63 |
$p ||= $z; |
| 64 |
$x[ 6] ||= $y; |
| 65 |
$x[ 7] ||= $z; |
| 66 |
$x[ 8] ||= 1; |
| 67 |
$x[ 9] ||= {}; |
| 68 |
$x[10] ||= \"foo"; |
| 69 |
$x[11] ||= \$y; |
| 70 |
$x[12] ||= \*STDIO; |
| 71 |
$x[13] ||= sub { 1 }; |
| 72 |
$x[14] ||= *::foo{SCALAR}; |
| 73 |
$x[15] ||= *STDIO{IO}; |
| 74 |
$x[16] ||= bless {}, "XXX"; |
| 75 |
$x[17] ||= $i == 1; |
| 76 |
$w ||= ref($i) eq "SCALAR"; |
| 77 |
$x[18] ||= <<"EOD"; |
| 78 |
blah |
| 79 |
EOD |
| 80 |
cond_dor(\@x) if exists &cond_dor; |
| 81 |
sub { $x[19] ||= 1 }; |
| 82 |
} |
| 83 |
|
| 84 |
# print join(", ", @x), "\n"; |