in reply to Re^2: Feedback on my second script
in thread Feedback on my second script

Yes, if you want to extend the program later to send the output via mail (but only in the case of error), your current approach makes sense.