|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: Execute shell command, grab it's return, terminate on timeoutby wind (Priest) |
| on Mar 21, 2014 at 00:52 UTC ( [id://1079148]=note: print w/replies, xml ) | Need Help?? |
|
This is a side note about code style suggestions 1) It really would be wise to use named parameters for all your methods. Your code would become self-documenting and you wouldn't have to preface your code with a description of what your parameters were when posting on perlmonks. 2) You also have a comment next to @cmd, describing it as a return value. Why not just name it @return_val? Then no need for a comment. 3) Finally, if you look at the documentation for alarm, you'll see a suggestion on how to propagate errors that don't revolve around the alarm. If your command fails on things other than the Timeout, you're probably going to want to know that.
Good luck getting assistance with your requested problem, - Miller
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||