use strict; use warnings; # Number of parallel tasks my %options = (); $options{workers} = 8; # Execute tasks in parallel my @results = iterate_as_array( \%options, $worker, \@tasks );