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

You could use grep and the core List::Util::max() to get what you want.

johngg@shiraz:~/perl/Monks > perl -Mstrict -Mwarnings -MList::Util=max + -E ' my @tests = ( [ 17, -3, 12 ], [ 2, 4, 6 ], [ -7, -4, -11 ], [ -5, 5, 16 ], ); foreach my $test ( @tests ) { my $maxOdd = max grep { $_ % 2 } @$test; say $maxOdd ? $maxOdd : q{No result}; }' 17 No result -7 5

I hope this is helpful.

Cheers,

JohnGG