{
    "mode": "perldoc",
    "parameter": "File::FnMatch",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/File%3A%3AFnMatch/json",
    "generated": "2026-06-12T11:17:10Z",
    "synopsis": "use File::FnMatch qw(:fnmatch);    # import everything\n# shell-style: match \"/a/bc\", but not \"/a/.bc\" nor \"/a/b/c\"\nfnmatch(\"/a/*\", $fn, FNMPATHNAME|FNMPERIOD);\n# find our A- executables only\ngrep { fnmatch(\"A-*.exe\", $) } readdir SOMEDIR;",
    "sections": {
        "NAME": {
            "content": "File::FnMatch - simple filename and pathname matching\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use File::FnMatch qw(:fnmatch);    # import everything\n\n# shell-style: match \"/a/bc\", but not \"/a/.bc\" nor \"/a/b/c\"\nfnmatch(\"/a/*\", $fn, FNMPATHNAME|FNMPERIOD);\n\n# find our A- executables only\ngrep { fnmatch(\"A-*.exe\", $) } readdir SOMEDIR;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "File::FnMatch::fnmatch() provides simple, shell-like pattern matching.\n\nThough considerably less powerful than regular expressions, shell patterns are nonetheless\nuseful and familiar to a large audience of end-users.\n",
            "subsections": [
                {
                    "name": "Functions",
                    "content": "fnmatch ( PATTERN, STRING [, FLAGS] )\nReturns true if *PATTERN* matches *STRING*, undef otherwise. *FLAGS* may be the bitwise\nOR'ing of any supported FNM* constants (see below).\n"
                },
                {
                    "name": "Constants",
                    "content": "FNMNOESCAPE\nDo not treat a backslash ('\\') in *PATTERN* specially. Otherwise, a backslash escapes the\nfollowing character.\n\nFNMPATHNAME\nProhibit wildcards from matching a slash ('/').\n\nFNMPERIOD\nProhibit wildcards from matching a period ('.') at the start of a string and, if\nFNMPATHNAME is also given, immediately after a slash.\n\nOther possibilities include at least FNMCASEFOLD (compare \"qr//i\"), FNMLEADINGDIR to restrict\nmatching to everything before the first '/', FNMFILENAME as a synonym for FNMPATHNAME, and\nthe rather more exotic FNMEXTMATCH. Consult your system documentation for details.\n\nEXPORT\nNone by default. The export tag \":fnmatch\" exports the fnmatch function and all available FNM*\nconstants.\n"
                }
            ]
        },
        "PATTERN SYNTAX": {
            "content": "Wildcards are the question mark ('?') to match any single character and the asterisk ('*') to\nmatch zero or more characters. FNMPATHNAME and FNMPERIOD restrict the scope of the wildcards,\nnotably supporting the UNIX convention of concealing \"dotfiles\":\n\nBracket expressions, enclosed by '[' and ']', match any of a set of characters specified\nexplicitly (\"[abcdef]\"), as a range (\"[a-f0-9]\"), or as the combination these (\"[a-f0-9XYZ]\").\nAdditionally, many implementations support named character classes such as \"[[:xdigit:]]\".\nCharacter sets may be negated with an initial '!' (\"[![:space:]]\").\n\nLocale influences the meaning of fnmatch() patterns.\n",
            "subsections": []
        },
        "CAVEATS": {
            "content": "Most UNIX-like systems provide an fnmatch implementation. This module will not work on platforms\nlacking an implementation, most notably Win32.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "File::Glob, POSIX::setlocale, fnmatch(3)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Michael J. Pomraning\n\nPlease report bugs to <mjp-perl AT pilcrow.madison.wi.us>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "Copyright 2005 by Michael J. Pomraning\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        }
    },
    "summary": "File::FnMatch - simple filename and pathname matching",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "fnmatch",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/fnmatch/3/json"
        }
    ]
}