diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-11-13 14:40:56 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-11-13 14:40:56 +0000 |
commit | 602848d7fba65f080b8a5a3f46b881b48320e4f5 (patch) | |
tree | 618368bc5473795b0616a0d46f21274744fe13ba | |
parent | 3cfc42b677f1599e57e63ae189f5d39d1e5d8f5e (diff) | |
download | perl-MDK-Common-602848d7fba65f080b8a5a3f46b881b48320e4f5.tar perl-MDK-Common-602848d7fba65f080b8a5a3f46b881b48320e4f5.tar.gz perl-MDK-Common-602848d7fba65f080b8a5a3f46b881b48320e4f5.tar.bz2 perl-MDK-Common-602848d7fba65f080b8a5a3f46b881b48320e4f5.tar.xz perl-MDK-Common-602848d7fba65f080b8a5a3f46b881b48320e4f5.zip |
add/remove spaces to make perl_checker happy
-rw-r--r-- | MDK/Common/DataStructure.pm | 2 | ||||
-rw-r--r-- | MDK/Common/File.pm | 2 | ||||
-rw-r--r-- | MDK/Common/Func.pm | 2 | ||||
-rw-r--r-- | MDK/Common/Math.pm | 12 | ||||
-rw-r--r-- | MDK/Common/String.pm | 8 |
5 files changed, 13 insertions, 13 deletions
diff --git a/MDK/Common/DataStructure.pm b/MDK/Common/DataStructure.pm index 3da59fe..a48afe4 100644 --- a/MDK/Common/DataStructure.pm +++ b/MDK/Common/DataStructure.pm @@ -153,7 +153,7 @@ sub list2kv { sub group_by2 { my @l; - for (my $i = 0; $i < @_ ; $i += 2) { + for (my $i = 0; $i < @_; $i += 2) { push @l, [ $_[$i], $_[$i+1] ]; } @l; diff --git a/MDK/Common/File.pm b/MDK/Common/File.pm index d3a4fd3..d67da06 100644 --- a/MDK/Common/File.pm +++ b/MDK/Common/File.pm @@ -177,7 +177,7 @@ sub touch { local *F; open F, ">$f"; } - my $now = time; + my $now = time(); utime $now, $now, $f; } diff --git a/MDK/Common/Func.pm b/MDK/Common/Func.pm index 56e032a..b655ec8 100644 --- a/MDK/Common/Func.pm +++ b/MDK/Common/Func.pm @@ -173,7 +173,7 @@ sub fold_left(&@) { my ($f, $initial, @l) = @_; local ($::a, $::b); $::a = $initial; - foreach $::b (@l) { $::a = &$f() } + foreach (@l) { $::b = $_; $::a = &$f() } $::a } diff --git a/MDK/Common/Math.pm b/MDK/Common/Math.pm index faf700e..a261433 100644 --- a/MDK/Common/Math.pm +++ b/MDK/Common/Math.pm @@ -125,15 +125,15 @@ sub even { $_[0] % 2 == 0 } sub odd { $_[0] % 2 == 1 } sub sqr { $_[0] * $_[0] } sub sign { $_[0] <=> 0 } -sub round { int ($_[0] + 0.5) } +sub round { int($_[0] + 0.5) } sub round_up { my ($i, $r) = @_; $i = int $i; $i += $r - ($i + $r - 1) % $r - 1 } sub round_down { my ($i, $r) = @_; $i = int $i; $i -= $i % $r } sub divide { my $d = int $_[0] / $_[1]; wantarray ? ($d, $_[0] % $_[1]) : $d } -sub min { my $n = shift; $_ < $n and $n = $_ foreach @_; $n } -sub max { my $n = shift; $_ > $n and $n = $_ foreach @_; $n } -sub or_ { my $n = 0; $n ||= $_ foreach @_; $n } -sub and_{ my $n = 1; $n &&= $_ foreach @_; $n } -sub sum { my $n = 0; $n += $_ foreach @_; $n } +sub min { my $n = shift; $_ < $n and $n = $_ foreach @_; $n } +sub max { my $n = shift; $_ > $n and $n = $_ foreach @_; $n } +sub or_ { my $n = 0; $n ||= $_ foreach @_; $n } +sub and_ { my $n = 1; $n &&= $_ foreach @_; $n } +sub sum { my $n = 0; $n += $_ foreach @_; $n } sub product { my $n = 1; $n *= $_ foreach @_; $n } diff --git a/MDK/Common/String.pm b/MDK/Common/String.pm index 8ea1c3c..b5a588c 100644 --- a/MDK/Common/String.pm +++ b/MDK/Common/String.pm @@ -75,10 +75,10 @@ sub bestMatchSentence { foreach (@_) { my $count = 0; foreach my $e (@s) { - $count+= length ($e) if /^$e$/; - $count+= length ($e) if /^$e$/i; - $count+= length ($e) if /$e/; - $count+= length ($e) if /$e/i; + $count += length($e) if /^$e$/; + $count += length($e) if /^$e$/i; + $count += length($e) if /$e/; + $count += length($e) if /$e/i; } $best = $count, $bestSentence = $_ if $count > $best; } |