Help for this page

Select Code to Download


  1. or download this
    my @allFruit = qw/apple apricot banana coconut/;
    my @someFruit = map { if ($_ =~ m/^[ap]/) { $_;} } @allFruit;
    print "no. of some fruit: " . scalar(@someFruit) . "\n";
    print "some fruit: " . join('*',@someFruit) . "\n";
    
  2. or download this
    no. of some fruit: 4
    some fruit: apple*apricot**
    
  3. or download this
    no. of some fruit: 2
    some fruit: apple*apricot