<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Find the number of each 2 consecutive characters AA, AC,AG,AT,CC,CA... with Perl]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/27403/find-the-number-of-each-2-consecutive-characters-aa-acagatccca-with-perl?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/27403/find-the-number-of-each-2-consecutive-characters-aa-acagatccca-with-perl?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/27403/find-the-number-of-each-2-consecutive-characters-aa-acagatccca-with-perl</guid>
	<pubDate>Wed, 18 May 2016 08:50:04 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/27403/find-the-number-of-each-2-consecutive-characters-aa-acagatccca-with-perl</link>
	<title><![CDATA[Find the number of each 2 consecutive characters AA, AC,AG,AT,CC,CA... with Perl]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl -w

use strict;

my $subject = &quot;AACGTACTGACGTACTGGTTGGTACGA&quot;;
my %results = ();
while ($subject =~ m/[ACTG][ATGC]/g) {
    # matched text = $&amp;
        if(exists $results{$&amp;})
        {
            $results{$&amp;}++ 
        }
        else
        {
            $results{$&amp;} = 1;
        }
}

foreach (sort keys %results) {
    print &quot;$_ : $results{$_}\n&quot;;
  }</code>]]></description>
	<dc:creator>Jit</dc:creator>
</item>

</channel>
</rss>