System::Timeout - extend system to allow timeout after specified seconds
system
Normal Usage
use System::Timeout qw(timeout); timeout("sleep 9"); # invoke CORE::system, will not timeout exit timeout("3", "sleep 9"); # timeout exit after 3 seconds
Overlay the Build-in system
use System::Timeout qw(system); system("3", "sleep 9");
Use the CLI tool
% timeout --timeout=3 "sleep 9" #Run command "Sleep 9" and timeout after 3 seconds
This module extends system to allow timeout after the specified seconds. Also include a cli tool "timeout" which can be easily used to force command exit after specified seconds.
Written by ChenGang, yikuyiku.com@gmail.com
http://blog.yikuyiku.com/
Copyright (c) 2011 ChenGang. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
IPC::Open3, IPC::Run, IPC::Cmd
To install System::Timeout, copy and paste the appropriate command in to your terminal.
cpanm
cpanm System::Timeout
CPAN shell
perl -MCPAN -e shell install System::Timeout
For more information on module installation, please visit the detailed CPAN module installation guide.