in reply to How can I make a string unique (quicker than my approach at least)
Cheers,use warnings; use strict; use List::Util qw(uniqstr); my $str = 'olivia-niels-peter-lars-niels-lars-olivia-olivia'; my @s = split /\-/, $str; print "@s\n"; my @s_new = uniqstr(@s); print "@s_new\n"; __END__ Outputs: olivia niels peter lars niels lars olivia olivia olivia niels peter lars
|
|---|