in reply to Re^4: combining array items to match a certain string
in thread combining array items to match a certain string

just for information, we are using a slightly modified version of the search code, which divides the words in commas and excludes similar outputs with doubled commas to divide the words, and, also, it puts the output in an @input array instead of printing it:
sub search { my ($target, $partsLu, $used) = @_; unless (length $target) { $v = join (",", @$used); if (substr($v, 0, 1) eq "," or $v =~ /,,/) {} else { push(@input, join (",", @$used))}; return; } for my $part (keys %$partsLu) { next unless 0 == index $target, $part; my $remainder = substr $target, length $part; delete $partsLu->{$part} unless --$partsLu->{$part}; search ($remainder, {%$partsLu}, [@$used, $part]); } }