# -- hash to store found exception dates my %fnd_excep = (); #### # -- loop thru the exception data from Voyager table foreach my $row ( @$arrayref_exc_dates ) { my ( $exception_date,$exception_openhour,$exception_closehour ) = @$row; if ( not defined $exception_openhour ) { $exception_openhour = "closed" } if ( not defined $exception_closehour ) { $exception_closehour = "closed" } # Maybe try something like this!! $fnd_excep{$exception_date} = { open => $exception_openhour, close => $exception_closehour, }; }