sub min { my $r; for (@_) { next unless defined; $r = $_ if !defined($r) || $_ < $r } $r }