in reply to Running an external GUI program

I have a bunch of PDFs that I need to compress

What sort of compression ? Both gzip and bzip2 compression can be done using perl without the need to shell out at all (by using Compress-Raw-Zlib and Compress-Raw-Bzip2, and other modules that offer higher level access).

Cheers,
Rob