File::MMagic 1.27 doesn't correctly handle subclassing. The object returned by new is blessed into 'File::MMagic' instead of the subclass. The author has accepted a patch to correct this behavior. Once the patched version is released on CPAN, new() should be removed and the fixed version required.
Implement MIME type detection using the module File::MMagic.