use IPC::Run qw( run timeout ); run \@cmd, \$in, \$out, \$err, timeout( 10 ) or die "cat: $?"