http://www.perlmonks.org?node_id=667741


in reply to to select unique characters

That is usually written like this:

my %seen; my @uniq = grep !$seen{$_}++, @proc_name1;

And if you want to localize the scope of the hash you could do it like this:

my @uniq = do { my %seen; grep !$seen{$_}++, @proc_name1; };