in reply to Re^2: removing duplicate entries from an array
in thread removing duplicate entries from an array

Dirtier:
print join ', ', keys %{(grep \@{$_}{@XYZ}, {})[0]};
;-)

Caution: Contents may have been coded under pressure.