theknightsofni has asked for the wisdom of the Perl Monks concerning the following question:
So essentially, I have @xyz_chunk containing arrays of 10 elements from @xyz. I need to be able to do something likewhile(@xyz) { my @copy = splice(@xyz,0,10); push @xyz_chunk, \@copy; } my @working; while(@xyz_chunk) { my $xyz_chunk = shift @xyz_chunk; @working = @$xyz_chunk; print "debug: @working\n"; }
But this is failing miserably (I need to only create 10 threads at any given time from each xyz_chunk element) and I am at the end of my wits. Any help is highly appreciated!!!!!!! Thanks!foreach my $val (@xyz_chunk) { threads->create("sub", $val); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help needed with regard to arrays
by toolic (Bishop) on Nov 20, 2008 at 01:30 UTC | |
|
Re: Help needed with regard to arrays
by GrandFather (Saint) on Nov 20, 2008 at 01:00 UTC | |
|
Re: Help needed with regard to arrays
by Corion (Patriarch) on Nov 20, 2008 at 07:43 UTC | |
by theknightsofni (Novice) on Nov 20, 2008 at 19:17 UTC | |
by Corion (Patriarch) on Nov 20, 2008 at 19:29 UTC | |
by theknightsofni (Novice) on Nov 20, 2008 at 19:48 UTC | |
by Corion (Patriarch) on Nov 20, 2008 at 20:18 UTC | |
| |
|
Re: Help needed with regard to arrays
by johngg (Canon) on Nov 20, 2008 at 11:06 UTC | |
by theknightsofni (Novice) on Nov 20, 2008 at 17:58 UTC | |
|
Re: Help needed with regard to arrays
by matrixmadhan (Beadle) on Nov 20, 2008 at 04:49 UTC |