in reply to Can a string be a file hanle?

I just want to get the whole result as a string.

Trying to find out what you mean... Do you want to return the printed string when you call   print? I am a bit puzzled.
The code you write will do what the node's title suggest, print to the filehandle that was passed to the subroutine.

Cheers, Sören