in reply to Splice an array into another array
Another way of operating directly on the DNA strings as strings (needs Perl version 5.10 or higher for \K regex operator):
c:\@Work\Perl\monks>perl -wMstrict -le "use 5.010; ;; use Test::More 'no_plan'; use Test::NoWarnings; ;; my $DNA3 = 'ATCGC'; my $DNA4 = 'AAATTGC'; ;; my $n = 1; $DNA3 =~ s{ \A .{$n} \K }{$DNA4}xms; ;; is $DNA3, 'AAAATTGCTCGC', 'string splice ok'; ;; done_testing; " ok 1 - string splice ok 1..1 ok 2 - no warnings 1..2
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Splice an array into another array
by Smeb (Novice) on Jun 23, 2017 at 23:17 UTC | |
by huck (Prior) on Jun 23, 2017 at 23:25 UTC | |
by Smeb (Novice) on Jun 23, 2017 at 23:33 UTC | |
by AnomalousMonk (Archbishop) on Jun 23, 2017 at 23:49 UTC | |
by Smeb (Novice) on Jun 24, 2017 at 03:46 UTC | |
by AnomalousMonk (Archbishop) on Jun 23, 2017 at 23:35 UTC | |
by Smeb (Novice) on Jun 23, 2017 at 23:37 UTC |