summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-08-12 21:43:23 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-08-12 21:43:23 +0000
commite03f94cb575827ae939c90132604ee5af8545b7a (patch)
tree4cc5c45cabc3c8c1d4e5969f92a531dab513e918 /perl-install/common.pm
parent107b1cbeace77c78d4885c138ca57d373a125bdf (diff)
downloaddrakx-backup-do-not-use-e03f94cb575827ae939c90132604ee5af8545b7a.tar
drakx-backup-do-not-use-e03f94cb575827ae939c90132604ee5af8545b7a.tar.gz
drakx-backup-do-not-use-e03f94cb575827ae939c90132604ee5af8545b7a.tar.bz2
drakx-backup-do-not-use-e03f94cb575827ae939c90132604ee5af8545b7a.tar.xz
drakx-backup-do-not-use-e03f94cb575827ae939c90132604ee5af8545b7a.zip
no_comment
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 9a21b7b57..77567726a 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) ],
+ 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) ],
functional => [ qw(fold_left difference2) ],
file => [ qw(dirname basename touch all glob_ cat_ chop_ mode) ],
system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ crypt_ getVarsFromSh) ],
@@ -129,6 +129,20 @@ sub untranslate($@) {
die "untranslate failed";
}
+sub warp_text($;$) {
+ my ($text, $width) = shift;
+ $width ||= 80;
+
+ my ($t, @l); foreach (split /(\s+)/, $text) {
+ if (length "$t$_" > $width) {
+ push @l, $t;
+ $t = '';
+ }
+ $t .= $_;
+ }
+ @l, $t;
+}
+
sub getVarsFromSh($) {
my %l;
local *F;