use threads;
my $thr = threads->create(\&sub1);
sub sub1 {
   print("In the thread\n");
}
$thr->join;
print "Finished\n";