diff options
author | damien <damien@mandriva.com> | 2001-03-06 00:08:45 +0000 |
---|---|---|
committer | damien <damien@mandriva.com> | 2001-03-06 00:08:45 +0000 |
commit | 71bdad5f0093737b768ef324e61221de573a1fe2 (patch) | |
tree | 932122721a5544f15f20617d8d401b5c792d1935 /perl-install | |
parent | 88a93870fb290186a2745474f995db27c53b395d (diff) | |
download | drakx-71bdad5f0093737b768ef324e61221de573a1fe2.tar drakx-71bdad5f0093737b768ef324e61221de573a1fe2.tar.gz drakx-71bdad5f0093737b768ef324e61221de573a1fe2.tar.bz2 drakx-71bdad5f0093737b768ef324e61221de573a1fe2.tar.xz drakx-71bdad5f0093737b768ef324e61221de573a1fe2.zip |
added setinhash
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/common.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index 2d8556201..84618b8a4 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -77,6 +77,7 @@ sub to_float { $_[0] =~ /(\d*(\.\d*)?)/; $1 } sub ikeys { my %l = @_; sort { $a <=> $b } keys %l } sub add2hash($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { $a->{$k} ||= $v } $a } sub add2hash_($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { exists $a->{$k} or $a->{$k} = $v } $a } +sub setinhash($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { $a->{$k} = $v } $a } sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 } sub dirname { @_ == 1 or die "usage: dirname <name>\n"; local $_ = shift; s|[^/]*/*\s*$||; s|(.)/*$|$1|; $_ || '.' } sub basename { @_ == 1 or die "usage: basename <name>\n"; local $_ = shift; s|/*\s*$||; s|.*/||; $_ } |