anchor.diff:      {
           foreach my $test_desc ( keys %scores )
           {
  -            foreach my $metric ( keys $scores{$test_desc} )
  +            foreach my $metric ( keys %{ $scores{$test_desc} } )
               {
                   foreach my $device_id ( 
  -                    keys $scores{$test_desc}{$metric} )
  +                    keys %{ $scores{$test_desc}{$metric} } )
                   {
                       my $weight = 
                           $weights_as_fractions{$policy}{$test_desc}{$metric};
  
positive.code: 
      foreach my $test_desc ( keys %normalized_scores )
      {
          foreach my $metric ( keys $normalized_scores{$test_desc} )
          {
              foreach my $device_id (
                  keys $normalized_scores{$test_desc}{$metric} )
              {
                  my @row_data = (
                      $device_id_to_display_name{$device_id},
  
negative.code: 
      foreach my $test_desc ( keys %std_scores )
      {
          foreach my $metric ( keys %{ $std_scores{$test_desc} })
          {
              my @values = values %{ $std_scores{$test_desc}{$metric} };
       
              my $min = min( @values );
              my $max = max( @values );
              
              foreach my $device_id ( keys %{ $std_scores{$test_desc}{$metric} })
              {
                  my $value = $std_scores{$test_desc}{$metric}{$device_id}; 
  
  