diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-02-21 19:22:12 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-02-21 19:22:12 +0000 |
commit | 8abe7a7e8c29a95d8229577b5ff0afaa74589fcc (patch) | |
tree | 36deb9889d4642b0078b687dfa4ad1a234ffc644 /perl-install/common.pm | |
parent | 1a6ceb9a7e98d4f7b3aa7e398519ca6a89d852e4 (diff) | |
download | drakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.tar drakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.tar.gz drakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.tar.bz2 drakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.tar.xz drakx-backup-do-not-use-8abe7a7e8c29a95d8229577b5ff0afaa74589fcc.zip |
no_comment
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index d6b9220c8..9f4716b8c 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -59,8 +59,8 @@ sub uniq { my %l; @l{@_} = (); keys %l } sub to_int { $_[0] =~ /(\d*)/; $1 } 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 } } -sub add2hash_($$) { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { exists $a->{$k} or $a->{$k} = $v } } +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 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|.*/||; $_ } |