in reply to right use of a hash table
You're referring to %M4 on this line:
and this one$M4{$target} = $M4{$target} + $M4_compteur{$target};
but declare only $M4, on this line:$M4{$target} = $M4{$target}/$Duration;
my $M4;
It appears you are doing the same thing with the variable $M4_compteur.
Try changing
my $M4; my $M4_compteur;
to
my %M4; my %M4_compteur;
The sigils ($, %, &, *, @) are important. I also find them slightly confusing, as $this, %this, @this, and &this are completely distinct, but the elements of %this and @this are referenced as $this{one} and $this$one. To ease my confusion, I tend to avoid giving scalars, arrays, hashes, and functions names that are the same or too similar.
|
|---|