You can reduce the amount of work (and code) by doing:
my %seen; $seen{$_}++ for @temp; [download]
In reply to Re: objects and duplicates by stiller in thread objects and duplicates by lkperl