diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-07-20 00:28:02 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-07-20 00:28:02 +0000 |
commit | 21f753634113afa55eda54a495017c5eef8fc462 (patch) | |
tree | e017dc86e92d288b17aa7a94479af392da8940f1 /perl-install/common.pm | |
parent | 60225ecd25a9879c5484e4d65f2e1c05388010b3 (diff) | |
download | drakx-21f753634113afa55eda54a495017c5eef8fc462.tar drakx-21f753634113afa55eda54a495017c5eef8fc462.tar.gz drakx-21f753634113afa55eda54a495017c5eef8fc462.tar.bz2 drakx-21f753634113afa55eda54a495017c5eef8fc462.tar.xz drakx-21f753634113afa55eda54a495017c5eef8fc462.zip |
no_comment
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index cbbc79ff2..1ad2f85b1 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -7,7 +7,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int @ISA = qw(Exporter); %EXPORT_TAGS = ( common => [ qw(__ even odd arch better_arch compat_arch min max sqr sum and_ or_ sign product bool invbool listlength bool2text bool2yesno text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines deref) ], - functional => [ qw(fold_left compose map_index grep_index map_each grep_each list2kv map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie combine) ], + functional => [ qw(fold_left compose mapgrep map_index grep_index map_each grep_each list2kv map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie combine) ], file => [ qw(dirname basename touch all glob_ cat_ output symlinkf chop_ mode typeFromMagic expand_symlinks) ], system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableRam availableMemory removeXiBSuffix template2file formatTime unix2dos setVirtual) ], constant => [ qw($printable_chars $sizeof_int $bitof_int $SECTORSIZE %compat_arch) ], @@ -156,6 +156,16 @@ sub touch { utime $now, $now, $f; } +sub mapgrep(&@) { + my $f = shift; + my @l; + foreach (@_) { + my ($b, $v) = $f->($_); + push @l, $v if $b; + } + @l; +} + sub map_index(&@) { my $f = shift; my @v; local $::i = 0; |