Hi,

Been working away from the 'puter for a while and now I'm back, I have forgotten something. seem to be very foggy.

I need to compare/contrast the following two hashes. I need to know if the times of day are the same for each day of the week. if they are standard throughout the week I need to raise one specific value (eg 'standard') and if there is even just one time of day that is not related to all days, then I need to raise the value 'variable'.

My attempt is beneath these hashes but would anyone please advise firstly, if the comparison will identify any specific time that is not available on every day? (I just want to indentify if there is any variation in times across the week.

Secondly, is there a simpler way to code this? if so, can you give me a pointer

Code:
$days_and_times = {
          'Saturday' => {
                          '10:30 AM' => 3,
                          '12:15 PM' => 3,
                          '4:15 PM' => 3,
                          '2:15 PM' => 3
                        },
          'Tuesday' => {
                         '10:30 AM' => 3,
                         '12:15 PM' => 3,
                         '4:15 PM' => 3,
                         '2:15 PM' => 3
                       },
          'Sunday' => {
                        '10:30 AM' => 3,
                        '12:15 PM' => 3,
                        '4:15 PM' => 3,
                        '2:15 PM' => 3
                      },
          'Wednesday' => {
                           '10:30 AM' => 3,
                           '12:15 PM' => 3,
                           '4:15 PM' => 3,
                           '2:15 PM' => 3
                         },
          'Friday' => {
                        '10:30 AM' => 3,
                        '12:15 PM' => 3,
                        '4:15 PM' => 3,
                        '2:15 PM' => 3
                      },
          'Monday' => {
                        '10:30 AM' => 3,
                        '12:15 PM' => 3,
                        '4:15 PM' => 3,
                        '2:15 PM' => 3
                      },
          'Thursday' => {
                          '10:30 AM' => 3,
                          '12:15 PM' => 3,
                          '4:15 PM' => 3,
                          '2:15 PM' => 3
                        }
        };

$times_per_day = {
          '10:30 AM' => {
                          'Tuesday' => 3,
                          'Saturday' => 3,
                          'Sunday' => 3,
                          'Wednesday' => 3,
                          'Friday' => 3,
                          'Thursday' => 3,
                          'Monday' => 3
                        },
          '12:15 PM' => {
                          'Tuesday' => 3,
                          'Saturday' => 3,
                          'Sunday' => 3,
                          'Wednesday' => 3,
                          'Friday' => 3,
                          'Thursday' => 3,
                          'Monday' => 3
                        },
          '4:15 PM' => {
                         'Tuesday' => 3,
                         'Saturday' => 3,
                         'Sunday' => 3,
                         'Wednesday' => 3,
                         'Friday' => 3,
                         'Thursday' => 3,
                         'Monday' => 3
                       },
          '2:15 PM' => {
                         'Tuesday' => 3,
                         'Saturday' => 3,
                         'Sunday' => 3,
                         'Wednesday' => 3,
                         'Friday' => 3,
                         'Thursday' => 3,
                         'Monday' => 3
                       }
        };
Code:
foreach my $time_of_day ( keys %times_per_day ){
      
    my @days_of_week = keys %{$times_per_day{$time_of_day}};
	  
    foreach my $day ( @days_of_week ){
	  
        my @datd= (keys %{$days_and_times{$day}}); 
        if (!grep /$time_of_day/ , @datd ){ # if any $time_of_day is not shown for any day_of_week 
	    $times_type ='varied';
	}
	  
    }
	  
}
bazz