File: timers

package info (click to toggle)
libipc-run-perl 0.94-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 748 kB
  • sloc: perl: 5,750; makefile: 5
file content (12 lines) | stat: -rw-r--r-- 209 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl -w

use strict ;
use IPC::Run qw( :all ) ;

$IPC::Run::debug = 10 ;

alarm 5 ;
$SIG{ALRM} = sub { die "timeout never fired!" } ;

my $out ;
run [$^X, '-e', 'sleep 10'], ">", \$out, timeout 1 ;