in reply to Re^2: Splice an array into another array
in thread Splice an array into another array

See Re^3: Splice an array into another array, not all replies go to the bottom of the page, they go under the sub-post you are replying to

  • Comment on Re^3: Splice an array into another array

Replies are listed 'Best First'.
Re^4: Splice an array into another array
by Smeb (Novice) on Jun 23, 2017 at 23:33 UTC

    Could you explain this code a bit?  @DNA3=split('',join('',@DNA3)); I don't quite get what it means and why this is necessary for my script to work.

      @DNA3 = <DNA3handle>; # read all LINES of file into array chomp @DNA3; # remove any and all newlines @DNA3=split('',join('',@DNA3)); # join('',@DNA3) join all LINES into + one long line # split('', ...) split long line int +o list # of individual chara +cters # @DNA3= ... assign list of indi +vidual # characters to an ar +ray
      @DNA3 will end up looking something like  ('A', 'T', 'C', 'G', ...) See chomp, join, split.

      Update: Fixed up formatting of long comment lines for last statement.


      Give a man a fish:  <%-{-{-{-<

        thank you :)