Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my $word = 'Monastery';
    my $count = () = $page_text =~ /\b$word\b/gi;
    print "$word appears $count times.\n";
    
  2. or download this
    # $word is direct user input
    my $count = () = $page_text =~ m/\b$word\b/gi;