From d1213191f9beee0c14835aee80c8d3f669589250 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 5 Dec 2011 00:02:15 +0000 Subject: (find) introduce it from MDK::Common (needed for next commit) --- urpm/util.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'urpm/util.pm') diff --git a/urpm/util.pm b/urpm/util.pm index 26730a0d..58f15d12 100644 --- a/urpm/util.pm +++ b/urpm/util.pm @@ -7,6 +7,7 @@ use Exporter; our @ISA = 'Exporter'; our @EXPORT = qw(min max quotespace unquotespace add2hash_ + find remove_internal_name reduce_pathname offset_pathname untaint @@ -181,6 +182,12 @@ sub output_safe { 1; } +sub find(&@) { + my $f = shift; + $f->($_) and return $_ foreach @_; + undef; +} + sub append_to_file { my $f = shift; open(my $F, '>>', $f) or die "writing to file $f failed: $!\n"; -- cgit v1.2.1