I was going to suggest a change in data structure as well.
my $input = [
{
'team' => 'A-Team',
'employee' => 'Face',
'work_day' => '2006-08-28',
'other_data' => '123456789',
},
{
'team' => 'A-Team',
'employee' => 'Murdock',
'work_day' => '2006-08-28',
'other_data' => '123456789',
},
{
'team' => 'Military',
'employee' => 'Decker',
'work_day' => '2006-08-28',
'other_data' => '123456789',
},
];
To:
my %input = (
'A-Team' => {
{
'employee' => 'Face',
'work_day' => '2006-08-28',
'other_data' => '123456789',
},
{
'employee' => 'Murdock',
'work_day' => '2006-08-28',
'other_data' => '123456789',
},
},
'Military' => {
{
'employee' => 'Decker',
'work_day' => '2006-08-28',
'other_data' => '123456789',
},
},
);