A parenthetic note on debugging...
For the life of me I can't figure out what is wrong, I can run the above operation fine if I manually insert the DNA sequences into an array ...
It sometimes helps a lot to see just what data you have. If you had written debug statements like
you might have gotten further down the "That's not what I want/expect. Why not? Oh, of course..." path to wisdom. Nothing wrong with asking questions, but it's usually much more satisfying to manage on your own. See Data::Dumper, which is core. (I prefer Data::Dump::dd() and friends, but it's not core.) See also toolic's Basic debugging checklist.use Data::Dumper; ... open(DNA3handle, $DNA3file); @DNA3 = <DNA3handle>; print Dumper \@DNA3; # what's actually in the array right now? ... open(DNA4handle, $DNA4file); @DNA4 = <DNA4handle>; print Dumper \@DNA4; # ditto ...
And a note about Best Practices...
In your OPed code, I see things like the use of global variables and filehandles, no checking of open operations. These are all officially Frowned Upon. An extensive (and expensive!) discussion of Perl best practices can be found in TheDamian's Perl Best Practices. Not everyone (to put it mildly!) agrees with every recommended BP, but a thoroughly developed rationale is given for each. Another good discussion of current best practices is in chromatic's Modern Perl (free download here).
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: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |