in reply to Re: How do I read .pag files
in thread How do I read .pag files

Thank you! I misunderstood the original question.

There also are other modules to determine the type of a file, File::MMagic, File::MimeInfo and MIME::Detect.