Last change
on this file since 33053 was 31935, checked in by ak19, 7 years ago |
Moving test alarm code into the correct subdirectory.
|
File size:
633 bytes
|
Rev | Line | |
---|
[31928] | 1 | #!/usr/bin/perl -w
|
---|
| 2 |
|
---|
| 3 | # See http://www.perlmonks.org/?node_id=1127475
|
---|
| 4 | # http://www.perlmonks.org/?node_id=1127570
|
---|
| 5 |
|
---|
| 6 | # Google: perl open3 windows
|
---|
| 7 | # http://www.perlmonks.org/?node_id=869942
|
---|
| 8 | # http://www.perlmonks.org/?node_id=811650
|
---|
| 9 | # BUT:
|
---|
| 10 | # http://search.cpan.org/~toddr/IPC-Run-0.96/lib/IPC/Run.pm -> http://search.cpan.org/~toddr/IPC-Run-0.96/lib/IPC/Run.pm#Win32_LIMITATIONS
|
---|
| 11 |
|
---|
| 12 | use strict;
|
---|
| 13 | use warnings;
|
---|
| 14 |
|
---|
| 15 | print scalar localtime, "\n";
|
---|
| 16 |
|
---|
| 17 | eval {
|
---|
| 18 | $SIG{__DIE__} = sub { alarm(0) };
|
---|
| 19 | $SIG{ALRM} = sub { die "timeout" };
|
---|
| 20 | alarm(3);
|
---|
| 21 | sleep 5;
|
---|
| 22 | alarm(0);
|
---|
| 23 | };
|
---|
| 24 |
|
---|
| 25 | print $@ if $@;
|
---|
| 26 | print scalar localtime, "\n"; |
---|
Note:
See
TracBrowser
for help on using the repository browser.