in reply to finding combinations and removing selective duplicates

You could sort the elements, then store the stringified (comma-separated) sorted elements as hash keys, then print out just the hash keys:
use strict; use warnings; my %uniqs; while (<DATA>) { chomp; my @list = split /,/; my @sorted = sort {$a <=> $b} @list; $uniqs{ join ',', @sorted }++; } print "$_\n" for keys %uniqs; __DATA__ 1,2,4 1,2,3 4,2,1

prints:

1,2,4 1,2,3