Closed hklausing closed 9 years ago
I think you've misunderstood what that variable does, which is my own fault for not having clearer documentation. It doesn't timeout the capture itself, it times out waiting for Capture::Tiny's own internal tee subprocesses to be ready to proceed.
Do you plan to add such a feature? It is pretty common (for me) to use that when running external commands.
I don't think it fits for this module, because it's not just about capturing from system commands. If you're on *nix, CPAN has System::Timeout, which looks like does something like what you want.
I tried to used the timeout function to stop capturing with Perl v5.18.2. (Capture::Tiny v0.27). But my tests failed for this feature use with Linux Mint 17. Program execution is not stopped as expected if the defined timeout is over. The following code shows my tests for the two timeout variables.