in reply to Unique elements in an array

Try This
@list =(1,2,2,3,4,4,5); map{$hs{$_}++} @list; print keys %hs;