dideod.yang has asked for the wisdom of the Perl Monks concerning the following question:
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to stop command
by hippo (Archbishop) on Jul 22, 2018 at 10:08 UTC | |
by dideod.yang (Sexton) on Jul 22, 2018 at 10:29 UTC | |
by hippo (Archbishop) on Jul 22, 2018 at 10:52 UTC | |
|
Re: how to stop command
by haukex (Archbishop) on Jul 22, 2018 at 21:42 UTC | |
by tobyink (Canon) on Jul 23, 2018 at 04:26 UTC | |
by haukex (Archbishop) on Jul 23, 2018 at 17:39 UTC | |
|