use strict; use warnings; my ($x, $y, $z) = (-11,-13,4); my $max; for($x,$y,$z) { # next unless $_ % 2; if ($_ % 2) { $max = $_ unless defined $max; $max = $_ if $max < $_; } } print "max odd: ", $max || "not found","\n";