##
my %newhash = map {
$_ => [{
map {
delete $_->{COMP} => $_
} @{$hash{$_}}
}]
} keys %hash;
####
{
'103496-1' => {
'1234' => {
'FD' => '0010',
'CLVD' => '5678',
'Files' => [
{ 'hash' => 'a538346ad3485',
'File' => 'text.txt'
},
{ 'hash' => '237d97892376a',
'File' => 'text2.txt'
}
]
}
}
};
####
my %newhash = map {
$_ => {
map {
delete $_->{COMP} => $_
} @{$hash{$_}}
}
} keys %hash;