From 20d78c5dae8666fc3be9b72e83091f4b239dd5ad Mon Sep 17 00:00:00 2001 From: Mercier Pierre-Olivier Date: Thu, 26 Sep 2013 11:38:17 +0200 Subject: [PATCH] Search globing if ref is defined --- ACU/Grading.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ACU/Grading.pm b/ACU/Grading.pm index af1f112..4c4fa22 100644 --- a/ACU/Grading.pm +++ b/ACU/Grading.pm @@ -342,12 +342,15 @@ sub compute ($$$;$$$) $ref =~ s/\$LOGIN/$login/; } - my $glob = Tinyglob::tinyglob($ref); - if ($glob ne $ref) + if (defined $ref) { - my $value = 0; - $value += $ids->{$_} while (grep { /^$glob$/ } keys %$ids); - $ids->{ $ref } = $value; + my $glob = Tinyglob::tinyglob($ref); + if ($glob ne $ref) + { + my $value = 0; + $value += $ids->{$_} while (grep { /^$glob$/ } keys %$ids); + $ids->{ $ref } = $value; + } } my $ret = undef;