sub first_value (&@) { my $test = shift; local $_; foreach (@_) { return $_ if $test->(); } return undef; }