in reply to Printing to a Variable

Have a look at the section on tying file-handles in the perltie man page. I did something similar with XML::Writer a while back, which also expect a file-handle for output.

Odds are good, given the simple nature of the problem at hand, you can get away with writing only the TIEHANDLE, PRINT, CLOSE and DESTROY methods. You may not even need the DESTROY. But not knowing what the PDF libs are doing, you may have to provide PRINTF and WRITE (the method called when syswrite() gets called). Point is, you shouldn't need to bother with the read-oriented methods, at least.

--rjray