in reply to Reading from a filehandle written to by a subroutine?

I'm having a little trouble understanding this.

So presumably doing the simple thing:

open FOO, '>', $filename or die "Can't open $filename: $!\n"; $object->cat(\*FOO, $target);
"doesn't work". Can you elaborate a little on what doesn't go as you expect?

Also, you're saying it's OK with STDOUT, but you

want to read the data out of the filehandle
You can't read from STDOUT (not generally, anyway), so maybe the root of the problem is that you're trying to read from a file handle when it's opened for writing or vice versa?

Adding a little more detail will help to get you a more accurate solution.