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: <%-{-{-{-<
In reply to Re: Splice an array into another array
by AnomalousMonk
in thread Splice an array into another array
by Smeb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |