The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!/usr/local/lib/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;