in reply to capturing command output
Two aspects you might want to consider
In my projects, I have no real preference. I typically decide it case-base-case based on the "feeled risk of needing debugging info"
- writing to a temporary output file (as done in your example) might lead to troubles with write-access-rights
- writing to a temporary output file is helpful when debugging, as that file can be checked easily afterwards outside of perl (unless you delete it)
Update: Oooops! I have overlooked the pipe-symbol. So please ignore my answer above! Thanks for pointing this out, BrowserUk!