diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-09-10 09:15:24 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-09-10 09:15:24 +0000 |
commit | fd82c0312a315599fb0d766fa5c6b7be4b211ba3 (patch) | |
tree | d7a1e782db5b8b42cd9d4f5795d3da0b92871773 /perl-install/common.pm | |
parent | 1cfe6c79ba71ee10522049af62e959b79cd7c9ed (diff) | |
download | drakx-backup-do-not-use-fd82c0312a315599fb0d766fa5c6b7be4b211ba3.tar drakx-backup-do-not-use-fd82c0312a315599fb0d766fa5c6b7be4b211ba3.tar.gz drakx-backup-do-not-use-fd82c0312a315599fb0d766fa5c6b7be4b211ba3.tar.bz2 drakx-backup-do-not-use-fd82c0312a315599fb0d766fa5c6b7be4b211ba3.tar.xz drakx-backup-do-not-use-fd82c0312a315599fb0d766fa5c6b7be4b211ba3.zip |
no_comment
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index 4b88b85ed..5fa40e2b1 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 sign product bool bool2text ikeys member divide is_empty_array_ref add2hash set_new set_add round_up round_down first second top uniq translate untranslate warp_text) ], + common => [ qw(__ min max sum sign product bool bool2text to_int ikeys member divide is_empty_array_ref add2hash set_new set_add round_up round_down first second top uniq translate untranslate warp_text) ], functional => [ qw(fold_left map_index map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie) ], file => [ qw(dirname basename touch all glob_ cat_ chop_ mode) ], system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ crypt_ getVarsFromSh setVarsInSh) ], @@ -40,6 +40,7 @@ sub first { $_[0] } sub second { $_[1] } sub top { $_[$#_] } sub uniq { my %l; @l{@_} = (); keys %l } +sub to_int { $_[0] =~ /(\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 member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 } |