- or download this
my $array2d = [];
my @list = (split /,/,join (",",@array));
$array2d->[$_%3][int($_/3)]=$list[$_] for (0..$#list);
- or download this
my @array2d = ();
my $c=0;
$array2d[$c%3][int($c++/3)]=$_ for (split /,/, join (",",@array));
- or download this
#!/usr/bin/perl -w
use strict;
...
$t->mark('V4 end');
$t->report();
- or download this
Devel::Timer Report -- Total time: 0.1663 secs
Interval Time Percent
...
02 -> 03 0.0319 19.15% V2 -> V3
00 -> 01 0.0002 0.09% INIT -> V1
- or download this
push @{ $splitted_up[($cnt ++) % 3] }, $_
foreach (split (/,/, join (",",@array)));