in reply to Re: Removing doubles and printing only unique values
in thread Removing doubles and printing only unique values
Better? I think so:say for do { # <-- mixed paradigms -------- my %seen; # <-- reinventing the wheel | grep { not $seen{ $_ } ++ } # <--------------------------- + map { ( split m{;} )[ 1 ] } # too much logic, but that's nitpickin +g <$inFH>; };'
You could of course roll your own implementation of uniq if you want to.use List::Util qw(uniqstr); say join "\n", uniqstr map { $_->[0] } map { [ split m{;} ] } <$inFH>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Removing doubles and printing only unique values
by johngg (Canon) on Nov 01, 2017 at 23:32 UTC | |
by holli (Abbot) on Nov 02, 2017 at 00:18 UTC |