I finished my month-long project a couple days early after a brainstorm yesterday, so I had a beer with lunch today. Don't tell my boss.
Here's a nifty perl snippet I came up with during the course of the project:
# uniq(("A","A","B","A","C","B")) ==> ("C","A","B")
# Order is not preserved.
sub uniq { return keys %{{map {$_ => $_} @_}} }