perl的线程(2)

#!/usr/bin/perl
#
use threads;

sub say_hello {
  printf("Hello thread! @_.\n");
  sleep(10);
  printf("Bye\n");
}

 sub quick_exit {
printf("I will be exit in no time\n");
exit(1);
}

my $t1 = threads->create( \&say_hello, "param1", "param2" );
my $t2 = threads->create( {'exit'=>'thread_only'}, \&quick_exit );

$t1->join();
$t2->join();

原文地址:https://www.cnblogs.com/djcsch2001/p/2031210.html