From a5481358e83dfcf67bdc9f8dd2e42e863f8e9f92 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 20 Oct 2012 01:23:41 -0500 Subject: first problem --- DNA.pl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 DNA.pl 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; -- cgit v1.2.3-54-g00ecf