Help for this page

Select Code to Download


  1. or download this
    my $parent = 'xxx xxx xxx';
    my $count = my @items = split(/ /, $parent);
    print "$count\n";  # 3
    
  2. or download this
    if    ($count < 1) { print "None\n";   }
    elsif ($count < 2) { print "Unique\n"; } 
    else               { print "$count\n"; }
    
  3. or download this
    my $parent = 'xxx yyy xxx zzz';
    
  4. 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
    
  5. 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"; }