in reply to Recording input and output of a command in file

I haven't used either of these, but it sounds like Tee or IO::Tee would allow you to easily write to multiple file handles.
  • Comment on Re: Recording input and output of a command in file