Help for this page

Select Code to Download


  1. or download this
    @sentence = split /\s/,"perlmonk perlmonk perlmonk "; 
    $numWords = @sentence;
    
  2. or download this
    @sentence = split /\s/,"perlmonk perlmonk perlmonk  and some other wor
    +ds that are not perlmonk"; 
    foreach $word (@sentence) { 
       if ( $word =~/perlmonk/) {
          $numOccur++;
       }
    }