So I should say that I actually solved it, but the syntax is horrible so I want to see that theres There is a Pearl-iSH way to do that which is good.
I have two arrays of length ( My attitude is right now; but a clear line for it Need for every additional column (right now I have two - name and length) Also it is hateful code only a mother can love. Note any ideas that what You can at least do the following: If you do not care about input arrays, you can consume them: There are also some modules which you can use to iterate on many lists. For example, using With it, @jenase and
@names ). I want to add them to the combined values of a single 2D array.
$ num = Number of elements in each array of my @jen = (); Foreach My $ i (0 .. $ num-1) {foreach my $ j (0 .. 1) {if ($ j == 0) {push $ {$ genes [$ i]}, $ name [$ i ];} If ($ J == 1) {push @ {$ gene [$ i]}, $ length [$ i];}}}
@jinz = (\ lighthouse, \ @name);
foreach my $ i (0 .. $ num-1) {push @genes, [$ names [$ i], $ length [$ i]]; }
push @genes, [shift @ names , Shift @lengths] while @name;
list :: MoreUtils :: each_array :
Usage list :: MoreUtils qw (each_array); My $ is = every_are (@name, @length) while (mine ($ n, $ l) = $ it- & gt; ()) {push @genes, [$ n, $ l]; }
list :: MoreUtils :: pairwise :
Usage list :: MoreUtils qw (pairwise) with; @jenz = partner {[our $ one, our $ B]} @name, @langries; Algorithms :: Loops Recommended using 'mappers', with
algorithm :: loops :: mappers :
; @ Genus = mappakare {\ @_} \ (@name, @ langha)
No comments:
Post a Comment