Actually, I did read the question. If you follow the
threads in Getting STDERR to write to STDOUT? to Filehandle Filter. And there we see
talk of tieing. Update: I realise I'm making you work for
the answer and I didn't have anything better than what had
been mentioned in those nodes. And... If you can read the filehandle,
arrays are not a hurdle.
One last link, because now I'll be stubborn about giving
you the code. Filter::Handle by btrott