Archived
1
0

Try to fix grades

This commit is contained in:
Mercier Pierre-Olivier 2013-11-23 20:08:03 +01:00
parent b4fc037a06
commit be336da8d6

View File

@ -286,7 +286,7 @@ package Point;
use v5.10.1; use v5.10.1;
use strict; use strict;
use warnings; use warnings;
use Text::Glob qw( glob_to_regex ); use Text::Glob qw( glob_to_regex match_glob );
use Term::ANSIColor qw(:constants); use Term::ANSIColor qw(:constants);
use ACU::Log; use ACU::Log;
@ -352,9 +352,12 @@ sub compute ($$$;$$$)
if ($glob ne $ref) if ($glob ne $ref)
{ {
my $value = 0; my $value = 0;
for my $r (grep { /^$glob$/ } keys %$ids) { for my $r (grep { match_glob($ref, $_); } keys %$ids)
{
log DEBUG, "$glob match $r (expanded from $ref)";
$value += $ids->{ $r }; $value += $ids->{ $r };
} }
log DEBUG, "New $ref is now $value";
$ids->{ $ref } = $value; $ids->{ $ref } = $value;
} }
}; };