in reply to John Guttag's book - 2nd exercise. My attempt in Perl.

I am probably to late to be of any help, but I can add one significant detail. I find the logic more intuitive if we initialize the result with a large negative number. You can get the largest possible number from POSIX, but with only a small loss in generality, we can choose any number that is larger than any we expect in our input.
se strict; use warnings; #use POSIX qw(DBL_MAX); my $x = $ARGV[0] // -11; my $y = $ARGV[1] // -13; my $z = $ARGV[2] // -17; #my $MAX_NEG = -DBL_MAX; my $MAX_NEG = -99999; # Better to use DBL_MAX from POSIX my $max = $MAX_NEG; if ( $x % 2) { $max = $x ; } if ( $y % 2 and $y > $max ) { $max = $y ; } if ( $z % 2 and $z > $max ) { $max = $z ; } die "There are no odd values.\n" if ($max == $MAX_NEG) ; print "the largest odd number is $max.\n";

Note: I took the freedom to use the disallowed operator (//) to override the default values of $x, $y, and $z with values from the command line. I do not consider this part of the solution.

Bill