in reply to Help needed with regard to arrays

foreach my $val (@xyz_chunk) { threads->create("sub", $val); }

I might be wrong, shouldn't you be dereferencing the array ref before using it
foreach my $val (@$xyz_chunk) { threads->create("sub", $val); }