On Aug 9, 5:38 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote: > minky arora wrote: > > Hello Team, > > > I have a problem and I need some ideas to put me on the right track to > > form an algo: > > > I have four 8x12 arrays (Arr1,Arr2, Arr3,Arr4) and ONE 16x24 (ARR5) array. > > > Now these four arrays are formatted in a particular way by a robot( > > these are actually plates with wells ..I am dealing with > > Bioinformatics) > > > I need to write a perl script to automate the reformating of these > > four arrays into the one larger array.I knw the pattern that it has to > > follow, for example Arr1[1][1] ->ARR5[1][2] and so on. > > > Given a pattern is there a good programming practice to automate the > > process?Ofcourse I can run loops and make it messy. > > > Many thanks in advance, > > It all depends on how @Arr5 is built from the others.
It also depends on the extent to which you need to preserve the original arrays. Again assuming we're trying to put the arrays side-by-side (not interleaved, the OP gave us _no_ clue) you could simply combine the arrays thus: push @Arr1,@Arr2; push @Arr3,@Arr4; push @$_, @{shift @Arr3} for @Arr1; This would destroy some of the original arrays and end up with all the data in @Arr1. (You may want to swap the roles of @Arr3 and @Arr2 above) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/