I guess I imagined this:
my $parent = 'xxx xxx xxx'; my $count = my @items = split(/ /, $parent); print "$count\n"; # 3 [download] Since you have a count, all you need to check if there are duplicates +is check the count. if ($count < 1) { print "None\n"; } elsif ($count < 2) { print "Unique\n"; } else { print "$count\n"; }
And also missed where the OP agreed that his sample code is wrong...Oh! He hasn't.
In reply to Re^4: Counting SubStrings, Style Question
by Anonymous Monk
in thread Counting SubStrings, Style Question
by se@n
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |