my $timeout = 5; eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm $timeout; my @file_list = `ls user/test/`; alarm 0; }; if ($@) { die unless $@ eq "alarm\n"; # propagate unexpected errors # timed out } else { # didn't } # I want to keep go scrip after stop alarm my $file; my @file_list; foreach $file(@file_list){ print "$file\n"; }
In reply to how to stop command by dideod.yang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |