use 5.010; my ($x, $y, $z) = (-11,-13,4); if ($x % 2 and ($x > $y or not $y % 2) and ($x > $z or not $z % 2)) { say "$x is the largest odd"; } elsif ($y % 2 and ($y > $z or not $z % 2)) { say "$y is the largest odd"; } elsif ($z % 2) { say "$z is the largest odd"; } else { say "All numbers are even!"; } #### my @nums = (-11, -13, 4); my @candidates = sort { $a <=> $b } grep $_ % 2, @nums; if (@candidates) { say $candidates[-1]; } else { say "They're all even!"; }