in reply to Counting matches and removing duplicates
my %seen;
grep !$seen{$_}++, @LIST;
and then sort the list by names:
sort {uc($a) cmp uc($b)} @LIST;
( Note: I copied the first code snippet from https://stackoverflow.com/questions/7651/how-do-i-remove-duplicate-items-from-an-array-in-perl )
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Counting matches and removing duplicates
by hippo (Archbishop) on Nov 15, 2024 at 19:07 UTC | |
by soonix (Chancellor) on Nov 17, 2024 at 10:49 UTC | |
Re^2: Counting matches and removing duplicates
by jo37 (Curate) on Nov 15, 2024 at 19:02 UTC | |
by bliako (Abbot) on Nov 18, 2024 at 11:19 UTC |