in reply to Re^3: Exact string matching
in thread Exact string matching

try this
foreach ($cont =~ m/([a-z]{3})/g ){ $hash{$_}++; }
what do you mean by liner time? and lastly you need to modify the pattern depending on what you want, please work on it

Replies are listed 'Best First'.
Re^5: Exact string matching
by Corion (Patriarch) on Oct 16, 2011 at 16:30 UTC

    Note that your approach will only return non-overlapping trigrams:

    > perl -wle "print for 'howdoyoudo' =~ /([a-z]{3})/g" how doy oud

    I would advise the original poster to really work on the question and maybe search CPAN for Ngrams or Trigrams.