in reply to Easy detection of BOM

Sure, File::BOM is the way to go, why not :)

Kinda related are file/File::LibMagic, mimetype