diff options
author | Pascal Rigaux <pixel@mandriva.com> | 1999-08-30 18:50:40 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 1999-08-30 18:50:40 +0000 |
commit | 1defcba73b989b6a28826c563417a7c0fc251052 (patch) | |
tree | 1d5bff21637dc8fb4f21fb9846ef6175c045d3f5 /perl-install/common.pm | |
parent | fb80b8a8984779543f0f0c50d7f6dcb995e0ce96 (diff) | |
download | drakx-backup-do-not-use-1defcba73b989b6a28826c563417a7c0fc251052.tar drakx-backup-do-not-use-1defcba73b989b6a28826c563417a7c0fc251052.tar.gz drakx-backup-do-not-use-1defcba73b989b6a28826c563417a7c0fc251052.tar.bz2 drakx-backup-do-not-use-1defcba73b989b6a28826c563417a7c0fc251052.tar.xz drakx-backup-do-not-use-1defcba73b989b6a28826c563417a7c0fc251052.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 ee9101f96..4220b06d7 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 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 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 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) ], @@ -46,6 +46,7 @@ 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|.*/||; $_ } sub bool { $_[0] ? 1 : 0 } +sub bool2text { $_[0] ? "true" : "false" } 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 } @_ } |