diff options
| author | Abigail <abigail@abigail.be> | 2020-12-07 14:15:52 +0100 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2020-12-07 14:15:52 +0100 |
| commit | 60ae52346383e609bf9b551d2f4b6584285d394b (patch) | |
| tree | 502e73d970238657ee9fbdc58da439709c4f85f1 | |
| parent | 3a464f85c6f9d4420b7fc9752762a014d432502f (diff) | |
| download | perlweeklychallenge-club-60ae52346383e609bf9b551d2f4b6584285d394b.tar.gz perlweeklychallenge-club-60ae52346383e609bf9b551d2f4b6584285d394b.tar.bz2 perlweeklychallenge-club-60ae52346383e609bf9b551d2f4b6584285d394b.zip | |
Perl solution for week 90/part 1
| -rw-r--r-- | challenge-090/abigail/perl/ch-1.pl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/challenge-090/abigail/perl/ch-1.pl b/challenge-090/abigail/perl/ch-1.pl new file mode 100644 index 0000000000..02a3b15d0a --- /dev/null +++ b/challenge-090/abigail/perl/ch-1.pl @@ -0,0 +1,31 @@ +#!/opt/perl/bin/perl + +use 5.032; + +use strict; +use warnings; +no warnings 'syntax'; + +use experimental 'signatures'; +use experimental 'lexical_subs'; + +# +# Challenge: +# +# You are given a DNA sequence composed of one of four nitrogen-containing +# nucleobases cytosine (C), guanine (G), adenine (A) and thymine (T). +# +# Print the number of nucleiobases in the DNA sequence, and print the +# complementary sequence, where each T is replaced by an A, each A by a +# T, each G by a C, and each C by a G. +# + +# +# This is really trivial to do in Perl. y/// replaces letters by letters, +# and return the number of replacements -- since we're replacing all letters +# this is the required length. +# + +print y/TAGC/ATCG/, "\n", $_ while <>; + +__END__ |
