in reply to removing duplicates from an array of hashes
Here's a grep solution:
my %seen; @$ref = grep { ! $seen{$_->{id}}++ } @$ref; [download]
My test is in the spoiler.
-- Ken