diff options
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/util.pm | 7 |
1 files changed, 7 insertions, 0 deletions
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"; |