source: debug-testing/readWgetUsingAlarm/testing-alarm.pl@ 31935

Last change on this file since 31935 was 31935, checked in by ak19, 7 years ago

Moving test alarm code into the correct subdirectory.

File size: 633 bytes
Line 
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
12use strict;
13use warnings;
14
15print scalar localtime, "\n";
16
17eval {
18 $SIG{__DIE__} = sub { alarm(0) };
19 $SIG{ALRM} = sub { die "timeout" };
20 alarm(3);
21 sleep 5;
22 alarm(0);
23};
24
25print $@ if $@;
26print scalar localtime, "\n";
Note: See TracBrowser for help on using the repository browser.