Have a look at List::Util, List::MoreUtils
In reply to Re: finding the first unique element in an array by gopalr in thread finding the first unique element in an array by Anonymous Monk