From 6e2837dcdd4dff544631e3957ec57e91481a5490 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 17 Apr 2003 11:35:57 +0000 Subject: perl_checker compliance --- MDK/Common/Func.pm | 2 +- MDK/Common/String.pm | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/MDK/Common/Func.pm b/MDK/Common/Func.pm index 7f1a926..e954a0b 100644 --- a/MDK/Common/Func.pm +++ b/MDK/Common/Func.pm @@ -322,7 +322,7 @@ sub cdie { my ($err) = @_; foreach (@MDK::Common::Func::cdie_catches) { $@ = $err; - if (my $v = &{$_}(\$err)) { + if (my $v = $_->(\$err)) { return $v; } } diff --git a/MDK/Common/String.pm b/MDK/Common/String.pm index bf8ac90..2325623 100644 --- a/MDK/Common/String.pm +++ b/MDK/Common/String.pm @@ -132,15 +132,14 @@ sub formatAlaTeX { sub warp_text { - my ($text, $width) = @_; - $width ||= 80; + my ($text, $o_width) = @_; my @l; foreach (split "\n", $text) { my ($beg) = /^(\s*)/; my $t = ''; foreach (split /\s+/, $_) { - if (length "$beg$t $_" > $width) { + if (length "$beg$t $_" > ($o_width || 80)) { push @l, "$beg$t"; $beg = ''; $t = $_; -- cgit v1.2.1