Just a style point: assigning a scalar to a hash slice is quirky. Save a few keystrokes and have dimensional consistency by doing @unique{@names} = () instead.
Caution: Contents may have been coded under pressure.
Comment on Re^2: removing duplicate entries from an array