in reply to repeated merging of PDF-Files

Fellow monasterians, i am about to go crazy. The task is to merge multiple PDF-Files to one. Seems easy enough (hey, there is CPAN) and so i wrote the following algorithm:
Totally OT, but you may want to search CTAN instead. The pdfpages package come to mind, for example. I haven't the slightest idea of how it's implemented, nay I only have heard it mentioned - quite frequently and with good cmts!