YW. Here's a slightly cleaner implementation. The only caveat is that it abitrarially throws away any output received prior to the timeout occuring. Only you can decide how you want to signal timeout if you also wish to retrieve any partial output.

I guess this could form the basis of a whole CPAN module, but it just seems altogether too trivial for that?