in reply to finding combinations and removing selective duplicates

If you need to deal with combinatorial sequences :
Algorithm::Combinatorics

#!/usr/bin/perl use strict; use warnings; use Algorithm::Combinatorics qw(variations_with_repetition); my @data = qw(a b c); my $iter = variations_with_repetition( \@data, $#data ); while ( my $c = $iter->next ) { print @$c, "\n"; } __END__ Output: aa ab ac ba bb bc ca cb cc


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb