summaryrefslogtreecommitdiffstats
path: root/perl-install/common.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-09-19 20:23:15 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-09-19 20:23:15 +0000
commit19ca59fe329e6cb97cc3681e70c12d81a022dbcc (patch)
tree63854174408e6a69b7735815d35d053dafc4e8c9 /perl-install/common.pm
parent25f65beed0677fa247c513705dbf538225f979c4 (diff)
downloaddrakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.tar
drakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.tar.gz
drakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.tar.bz2
drakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.tar.xz
drakx-19ca59fe329e6cb97cc3681e70c12d81a022dbcc.zip
no_comment
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r--perl-install/common.pm16
1 files changed, 14 insertions, 2 deletions
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;