PracticeDev/study_perl/test_die.pl

12 lines
186 B
Perl
Raw Normal View History

2022-12-20 17:31:11 +08:00
#!/usr/bin/perl
sub worker {
my ($id) = @_;
print "worker in id: $id\n";
die "num 6" if $id==6;
sleep(1);
}
for( $a = 0; $a < 10; $a = $a + 1 ){
worker($a)
}