in reply to Help with PDF module
PDF last saw a release 23 years ago, and has open bugs which would explain what you're seeing here. PDF::Builder has the page_count method, with a caveat about PDF versions supported.