From 19ca59fe329e6cb97cc3681e70c12d81a022dbcc Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 19 Sep 1999 20:23:15 +0000 Subject: no_comment --- perl-install/common.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'perl-install/common.pm') diff --git a/perl-install/common.pm b/perl-install/common.pm index 41ddbf98e..279307e85 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 sqr sum sign product bool listlength bool2text to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash set_new set_add round round_up round_down first second top uniq translate untranslate warp_text) ], + common => [ qw(__ 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 set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX) ], functional => [ qw(fold_left map_index 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) ], @@ -246,6 +246,19 @@ sub warp_text($;$) { @l; } +sub formatAlaTeX($) { + my ($t, $tmp); + foreach (split "\n", $_[0]) { + if (/^$/) { + $t .= ($t && "\n") . $tmp; + $tmp = ''; + } else { + $tmp = ($tmp && "$tmp ") . $_; + } + } + $t . ($t && $tmp && "\n") . $tmp; +} + sub getVarsFromSh($) { my %l; local *F; @@ -275,7 +288,6 @@ sub setVarsInSh { $l->{$_} and print F "$_=$l->{$_}\n" foreach @fields; } - sub best_match { my ($str, @lis) = @_; my @words = split /\W+/, $str; -- cgit v1.2.1