- or download this
my $parent = 'xxx xxx xxx';
my $count = my @items = split(/ /, $parent);
print "$count\n"; # 3
- or download this
if ($count < 1) { print "None\n"; }
elsif ($count < 2) { print "Unique\n"; }
else { print "$count\n"; }
- or download this
my $parent = 'xxx yyy xxx zzz';
- or download this
my $substring = 'xxx';
my $parent = 'xxx yyy xxx zzz';
my @count = split($substring,$parent);
my $total = $#count + 1;
print "there are $total $substring in $parent\n"; # XXX 3
- or download this
my $substring = 'xxx';
my $parent = 'xxx yyy xxx zzz';
...
if ($count < 1) { print "None\n"; }
elsif ($count < 2) { print "Unique\n"; }
else { print "$count\n"; }