#!/usr/bin/perl # The Great Computer Language Shootout # http://shootout.alioth.debian.org/ # # Contributed by dmpk2k use POSIX; $/ = '>'; # change line delimiter to > instead of \n ; # skip first result while () { s/^(.*?)\n//; # chop off description and print it print ">", $1, "\n"; tr{wsatugcyrkmbdhvnATUGCYRKMBDHVN\n>} # translate sequence {WSTAACGRYMKVHDBNTAACGRYMKVHDBN}d; my $sequence = reverse; my $iterations = ceil(length($sequence) / 60) - 1; for my $count (0 .. $iterations) { # print reverse complement print substr($sequence, $count * 60, 60), "\n" } }