#!/usr/bin/perl -w use strict; use threads; use PDL; my @array = qw (9 10 3 2 4 7 8 1 5 6); # Separate the data in threads, do the sub (e.g add one), # return values into array at their original position (indice) my @array = qw (resThread1 resThread2 ...) my $piddle = pdl (@array); my ($min, $max, $min_ind, $max_ind) = minmaximum($piddle); print $max_ind,"\n";