The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

System::Timeout - extend system to allow timeout after specified seconds

SYNOPSIS

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

DESCRIPTION

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.

AUTHOR

Written by ChenGang, yikuyiku.com@gmail.com

http://blog.yikuyiku.com/

COPYRIGHT

Copyright (c) 2011 ChenGang. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

IPC::Open3, IPC::Run, IPC::Cmd