anchor.diff:  
       foreach my $test_desc ( keys %scores )
       {
  -        foreach my $metric ( keys $scores{$test_desc} )
  -        {
  -            my $num_values = values $scores{$test_desc}{$metric};
  +        foreach my $metric ( keys %{$scores{$test_desc} } )
  +        {
  +            my $num_values = values %{ $scores{$test_desc}{$metric} };
   
               if( $num_values != $expected_num_values )
               {
  
positive.code: 
      foreach my $policy ( keys %weighted_score_components )
      {
          foreach my $test_desc ( keys $weighted_score_components{$policy} )
          {
              foreach my $metric (
                  keys $weighted_score_components{$policy}{$test_desc} )
              {
                  foreach my $device_id (
                      keys
                          $weighted_score_components
                          {$policy}
                          {$test_desc}
                          {$metric} )
                  {
                      my $weighted_score = 
                          $weighted_score_components
  
negative.code:     {
          foreach my $test_desc ( keys %scores )
          {
              foreach my $metric ( keys %{ $scores{$test_desc} } )
              {
                  foreach my $device_id ( 
                      keys %{ $scores{$test_desc}{$metric} } )
                  {
                      my $weight = 
                          $weights_as_fractions{$policy}{$test_desc}{$metric};
  