in reply to file(1) equivalent?

Most importantly, you need a "magic" file — typically /etc/magic (which is also used by the regular Unix file program).  It contains the patterns that are used for recognizing file types.   So if the idea is to use the Perl file utility on a non-Unix platform, don't forget to copy that magic file. (You can specify where it lives by setting the environment variable MAGIC.)

Other than that, the utility only uses core Perl modules (FindBin, FileHandle, Getopt::Long).

In other words, the installation steps would be

Note that this is an executable file, not a module, but you can of course also include the code (with minor modifications) into a program of your own...