Thanks! I really appreciate you taking the time to do that and I will definitely look at using it in my script to make things neater.
On another note, I actually solved my problem with a lucky find on Google instigated by tye's last comment. The package Test::More has a function where test output can be redirected to any file I like and can be split apart just like STDOUT and STDERR. Thanks for the input you all have already made and if there are any more suggestions to streamline the script I would welcome them!