#!/usr/bin/perl -w

# See http://www.perlmonks.org/?node_id=1127475
# http://www.perlmonks.org/?node_id=1127570

# Google: perl open3 windows
# http://www.perlmonks.org/?node_id=869942
# http://www.perlmonks.org/?node_id=811650
# BUT:
# 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

use strict;
use warnings;

print scalar localtime, "\n";

eval {
    $SIG{__DIE__} = sub { alarm(0) };
    $SIG{ALRM} = sub { die "timeout" };
    alarm(3);
    sleep 5;
    alarm(0);
};

print $@ if $@;
print scalar localtime, "\n";