Help for this page

Select Code to Download


  1. or download this
    my $file = join '', @file; # put it all in a single scalar
    if ($file =~ m/(?:what you want to find.*){6}/)
    {
      print "'what you want to find' was in the file at least 6 times.\n";
    }
    
  2. or download this
    my $count;
    while (<$fh>)
    ...
    {
      print "found 'what you want to look for' at least 6 times in the fil
    +e.\n";
    }