sub prepare_line($) { my $line = shift; chomp $line; my $l = $line; $l =~ s/^row\d+\s+//; $l =~ s/\s+//g; # Leerzeichen entfernen; $l =~ tr/-/ /; # '-' durch ' ' ersetzen, wg. Bitfilter my $mask = $l; $mask =~ tr/0/1/; # alle Ziffern => '1' return { line => $line, mask => $mask,pattern => $l}; } my @all = map {prepare_line($_)} (); foreach my $target (@all) { print "\nTarget:\t\t",$target->{line},"\n"; foreach my $comp (@all) { next if $target->{line} eq $comp->{line}; # gleiche Zeile print "Subset:\t\t",$comp->{line},"\n" if ($target->{pattern} & $comp->{mask}) eq $comp->{pattern}, } }