in reply to logical solution for a array of hash
The loop variable of your inner loop is $value yet the loop body does not use that variable. Try replacing $results there by $value.