sub first (&@) { my $code = shift; foreach (@_) { return $_ if &{$code}(); } undef; }