Jens Rehsack


File::Find::Rule::LibMagic - rule to match on file types or mime types


    use File::Find::Rule::LibMagic;

    my @executables = find( file => magic => '*executable*', in => $searchdir );
    my @images = find( file => mime => 'image/*', in => $homepagebase );


File::Find::Rule::LibMagic extends File::Find::Rule by matching files depending on their magic file type or MIME type delivered through File::LibMagic from file(1) UNIX command.

Every UNIX user (or users of unix-like systems) knows the file(1) command. With this module files can be found depending on their file type from magic database or their MIME type.

It conflicts with File::Find::Rule::MMagic.


This module doesn't export any function. The provided functionality is called by File::Find::Rule according to the matching rules.



Accepts a list of strings or regular expressions which are approved to match the result of File::LibMagic/checktype_filename.


Accepts a list of strings or regular expressions which are approved to match the result of File::LibMagic/describe_filename.


Jens Rehsack, <rehsack at>


Please report any bugs or feature requests to bug-file-find-rule-libmagic at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc File::Find::Rule::LibMagic

You can also look for information at:


Copyright 2010 Jens Rehsack.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 48:

alternative text 'File::LibMagic/checktype_filename' contains non-escaped | or /

Around line 53:

alternative text 'File::LibMagic/describe_filename' contains non-escaped | or /