zerocred has asked for the wisdom of the Perl Monks concerning the following question:
Solved - but is there a neater way? Array slices? zforeach $row (0..$#A){ #array row length foreach $col (0 .. ($#{$A[0]} - 1) ) { #array width less one $b->[$row*2][$col] = $a->[$row][$col]; # copy all but last ele ove +r } $b->[($row *2) +1][0] = $a->[$row][$#{$A[0]}]; #now copy last #there are twice as many rows so we double the row index }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: array confusion
by jwkrahn (Abbot) on May 11, 2012 at 05:55 UTC | |
by tobyink (Canon) on May 11, 2012 at 06:34 UTC | |
by zerocred (Beadle) on May 11, 2012 at 05:58 UTC | |
|
Re: array confusion
by BrowserUk (Patriarch) on May 11, 2012 at 06:04 UTC | |
by zerocred (Beadle) on May 11, 2012 at 07:18 UTC | |
by BrowserUk (Patriarch) on May 11, 2012 at 07:22 UTC | |
by zerocred (Beadle) on May 11, 2012 at 09:08 UTC |