in reply to finding the distinct elements in an array

Hi beginr,

I can see that this is your first post, Welcome to the Monastery! Make yourself at home., Please read Perl monks Faqs and do Super Search before posting.

@newarray = grep (!$unique{$_}++, @array); print @newarray;

There are some modules as well List::Unique, List::Uniq etc.

Prasad