summaryrefslogtreecommitdiffstats
path: root/DNA.pl
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-20 01:23:41 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-20 01:23:41 -0500
commita5481358e83dfcf67bdc9f8dd2e42e863f8e9f92 (patch)
tree652e2d00e98162e6f9b4d4e65fa8dafac4fb849d /DNA.pl
downloadrosalind-a5481358e83dfcf67bdc9f8dd2e42e863f8e9f92.tar.gz
rosalind-a5481358e83dfcf67bdc9f8dd2e42e863f8e9f92.zip
first problem
Diffstat (limited to 'DNA.pl')
-rw-r--r--DNA.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/DNA.pl b/DNA.pl
new file mode 100644
index 0000000..c432b03
--- /dev/null
+++ b/DNA.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+my $string = <>;
+$string =~ s/[^ACGT]//g;
+my $length = length($string);
+
+$string =~ s/A//g;
+print $length - length($string);
+$length = length($string);
+
+print " ";
+
+$string =~ s/C//g;
+print $length - length($string);
+$length = length($string);
+
+print " ";
+
+$string =~ s/G//g;
+print $length - length($string);
+$length = length($string);
+
+print " ";
+print $length;