in reply to Using MAP to swap around HoA hash keys and array values.
my %new_hash = map { splice( @{ $hash{ $_ } }, 0, 1, $_ ), [ @{ $hash{ + $_ } } ] } keys %hash; [download]