#!/usr/bin/perl -w
use strict;
undef $/; # Input Record separator
open (FILE, "INPUT") || die "cannot open $!\n";
my $var=<FILE>; # Assign the file handler to scalar variable
close (FILE);
my $match=qq{aaggtaaggt}; # Declare your text
my $count=0;
# ($match) -> aaggtaaggt
# (.{100})? -> any 100 character match o or 1 times
$count++ while ($var=~ m{($match)(.{100})?}gs);
print "\nAs per rule text '$match' find $count times";
Reputation Points: 55
Solved Threads: 24
Junior Poster in Training
Offline 93 posts
since Jun 2009