in reply to to avoid redundacy in a file
Mind you that this is feasible for small files, for certain values of small. If your file is large, you may want to just do the join line, write it to another file, and then let a sort -u do your bidding. That assumes that you are on Unix or one of its derivatives (unless there is sort for Windoze... :)my %hash while(<>){ my $key = join " ", (sort (split " ")); $hash{$key} = 1; } #now iterate over the keys of the hash, and either print them out, or +do your insert in to the database
thor
|
|---|