diff options
author | Francois Pons <fpons@mandriva.com> | 1999-09-28 15:53:43 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 1999-09-28 15:53:43 +0000 |
commit | 99c9b0680ce235c7e5bb6d18a8154a147e70947c (patch) | |
tree | e42f58e16872cdf6f4030936f9050ebc5bb99b20 /perl-install/common.pm | |
parent | 4d1e2e9740a607609d497adf72dbef43e9f1a4c8 (diff) | |
download | drakx-99c9b0680ce235c7e5bb6d18a8154a147e70947c.tar drakx-99c9b0680ce235c7e5bb6d18a8154a147e70947c.tar.gz drakx-99c9b0680ce235c7e5bb6d18a8154a147e70947c.tar.bz2 drakx-99c9b0680ce235c7e5bb6d18a8154a147e70947c.tar.xz drakx-99c9b0680ce235c7e5bb6d18a8154a147e70947c.zip |
*** empty log message ***
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 35bed9e67..8d6bf4307 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(__ even odd min max sqr sum sign product bool listlength bool2text 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) ], + common => [ qw(__ even odd min max sqr sum sign product bool listlength bool2text 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) ], functional => [ qw(fold_left compose map_index grep_index map_each grep_each 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) ], @@ -60,6 +60,7 @@ sub basename { @_ == 1 or die "usage: basename <name>\n"; local $_ = shift; s|/* sub bool { $_[0] ? 1 : 0 } sub listlength { scalar @_ } sub bool2text { $_[0] ? "true" : "false" } +sub text2bool { my $t = lc($_[0]); $t eq "true" || $t eq "yes" ? 1 : 0 } sub strcpy { substr($_[0], $_[2] || 0, length $_[1]) = $_[1] } sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = <F>; wantarray ? @l : join '', @l } sub chop_ { map { my $l = $_; chomp $l; $l } @_ } |