in reply to Count Colour Pages in PDF

What do you mean by "without opening the pdf"? You will need to use the open function to read the file. If you don't want to "open a window for the user", that's likely possible.

A cursory glance through PDF::API2 doesn't tell anything, so maybe you'll have to inspect all page objects and check whether they are an image ("likely" colored) or using a non-grayscale color.