in reply to Re: Track command time
in thread Track command time

This approach (using open vs system) has the added advantage of allowing for concurrency. If you want to run N commands simultaneously, and report errors on those that timeout, this is easy to do. You can use select on all the open filehandles to catch when they output/complete.

Replies are listed 'Best First'.
Re^3: Track command time
by Corion (Patriarch) on Oct 03, 2008 at 21:28 UTC

    No. You can only have one alarm and the sequence of setting/resetting $SIG{ALRM} will certainly lead to race conditions.