summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-07-30 11:16:01 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-07-30 11:16:01 +0000
commit3d79e422764401cf0d18a86bdf2679511119cdbc (patch)
treed54b9d808abea542594e7a7b5da7687d27dfa474 /perl-install/common.pm
parent0ec07d89144fab40d351a24dca0645eca179ce29 (diff)
downloaddrakx-backup-do-not-use-3d79e422764401cf0d18a86bdf2679511119cdbc.tar
drakx-backup-do-not-use-3d79e422764401cf0d18a86bdf2679511119cdbc.tar.gz
drakx-backup-do-not-use-3d79e422764401cf0d18a86bdf2679511119cdbc.tar.bz2
drakx-backup-do-not-use-3d79e422764401cf0d18a86bdf2679511119cdbc.tar.xz
drakx-backup-do-not-use-3d79e422764401cf0d18a86bdf2679511119cdbc.zip
no_comment
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index ec8f92366..c6d96682c 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- common => [ qw(_ __ min max sum bool member divide is_empty_array_ref add2hash set_new set_add round_up round_down first second top uniq translate untranslate) ],
+ common => [ qw(_ __ min max sum bool ikeys member divide is_empty_array_ref add2hash set_new set_add round_up round_down first second top uniq translate untranslate) ],
functional => [ qw(fold_left) ],
file => [ qw(dirname basename touch all glob_ cat_ chop_ mode) ],
system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ crypt_) ],
@@ -30,6 +30,7 @@ sub first { $_[0] }
sub second { $_[1] }
sub top { $_[$#_] }
sub uniq { my %l; @l{@_} = (); keys %l }
+sub ikeys { my %l = @_; sort { $a <=> $b } keys %l }
sub add2hash { my ($a, $b) = @_; while (my ($k, $v) = each %{$b || {}}) { $a->{$k} ||= $v } }
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|; $_ || '.' }