in reply to Re^3: Counting SubStrings, Style Question
in thread Counting SubStrings, Style Question
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Counting SubStrings, Style Question
by ikegami (Patriarch) on Mar 21, 2010 at 05:09 UTC |