#!/usr/bin/perl use strict; use warnings; use threads; use myTest; my @threads; foreach ( 1..2 ) { print "launching job\n"; my $test = myTest->new(); push( @threads , threads->new( $test->myTestFunc )); } foreach my $thread ( @threads ) { my @command_output = $thread->join ; print "job done\n"; }