summaryrefslogtreecommitdiffstats
path: root/REVP.pl
diff options
context:
space:
mode:
Diffstat (limited to 'REVP.pl')
-rw-r--r--REVP.pl16
1 files changed, 16 insertions, 0 deletions
diff --git a/REVP.pl b/REVP.pl
new file mode 100644
index 0000000..b6bce2b
--- /dev/null
+++ b/REVP.pl
@@ -0,0 +1,16 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use 5.016;
+
+chomp(my $input = <>);
+
+for my $start (1..length($input)) {
+ for my $length (4..8) {
+ next if $start + $length - 1 > length($input);
+ my $substr = substr($input, $start - 1, $length);
+ if ($substr eq (reverse $substr =~ tr/ACGT/TGCA/r)) {
+ say "$start $length";
+ }
+ }
+}