From e03f94cb575827ae939c90132604ee5af8545b7a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 12 Aug 1999 21:43:23 +0000 Subject: no_comment --- perl-install/common.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'perl-install/common.pm') 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; -- cgit v1.2.1