sub make_max_finder { my $max; sub { for (@_) { $max = $_ if !defined $max || $_ > $max } $max; } }