If you're only interested in is counting the pages in TIFF files, you don't need Imager. Check out this node for a pure Perl solution. The program counts the pages per TIFF file, so all you would need is a slight modification to totalize the count from all files.