Problème de compréhension avec un HASH
Bonjour,
Je suis nouveau sur Perl et j'ai du mal à comprendre ce code.
Ci-dessous l'appel de la fonction que je souhaite utiliser:
Code:
Bugzilla::Hook::process('bug_end_of_create_validators', { params => $params });
Ci-dessous la fonction en question:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| sub bug_end_of_create_validators {
my ($self, $args) = @_;
# This code doesn't actually *do* anything, it's just here to show you
# how to use this hook.
my $bug_params = $args->{'params'};
# Uncomment this line below to see a line in your webserver's error log
# containing all validated bug field values every time you file a bug.
# warn Dumper($bug_params);
# This would remove all ccs from the bug, preventing ANY ccs from being
# added on bug creation.
# $bug_params->{cc} = [];
} |
Si dans cette fonction je fais:
Code:
print($bug_params);
J'obtiens:
Citation:
HASH(0x293F0d8)
J'en conclu donc que c'est un HASH mais je ne sais pas ce qu'il contient.
En m'aidant de la FAQ je fais:
Code:
1 2 3 4
| foreach my $clef ( keys %bug_params )
{
print "$clef : $bug_params{$clef}\n";
} |
Mais j’obtiens toujours:
Citation:
HASH(0x293F0d8)
Je ne sais pas comment faire pour connaitre le contenu de cette variable.
Avez-vous une idée?
Merci.