for (my $i=0;$i<=3;$i++) { #-----performing the CHO loops as given by user-------# foreach (@finalOneClickarray) { push @threads, threads->new(\&concurrentBackupCommandsRead, $_); } foreach (@threads) { $_->join(); } } sub concurrentBackupCommandsRead() { doing my stuff here......... }