FastGlob - A faster glob() implementation


FastGlob documentation  | view source Contained in the FastGlob distribution.

Index


NAME

Top

FastGlob - A faster glob() implementation

SYNOPSIS

Top

        use FastGlob qw(glob);
        @list = &glob('*.c');

DESCRIPTION

Top

This module implements globbing in perl, rather than forking a csh. This is faster than the built-in glob() call, and more robust (on many platforms, csh chokes on echo * if too many files are in the directory.)

There are several module-local variables that can be set for alternate environments, they are listed below with their (UNIX-ish) defaults.

        $FastGlob::dirsep = '/';        # directory path separator
        $FastGlob::rootpat = '\A\Z';    # root directory prefix pattern
        $FastGlob::curdir = '.';        # name of current directory in dir
        $FastGlob::parentdir = '..';    # name of parent directory in dir
        $FastGlob::hidedotfiles = 1;    # hide filenames starting with .

So for MS-DOS for example, you could set these to:

        $FastGlob::dirsep = '\\';       # directory path separator
        $FastGlob::rootpat = '[A-Z]:';  # <Drive letter><colon> pattern
        $FastGlob::curdir = '.';        # name of current directory in dir
        $FastGlob::parentdir = '..';    # name of parent directory in dir
        $FastGlob::hidedotfiles = 0;    # hide filenames starting with .

And for MacOS to:

        $FastGlob::dirsep = ':';        # directory path separator
        $FastGlob::rootpat = '\A\Z';    # root directory prefix pattern
        $FastGlob::curdir = '.';        # name of current directory in dir
        $FastGlob::parentdir = '..';    # name of parent directory in dir
        $FastGlob::hidedotfiles = 0;    # hide filenames starting with .

INSTALLATION

Top

Copy this module to the Perl 5 Library directory.

COPYRIGHT

Top

AUTHOR

Top

Marc Mengel <mengel@fnal.gov>

REVISIONS

Top

Brad Appleton <bradapp@enteract.com> -- v1.2 Feb 1999

Modified to use qr// (and some other minor speedups) and made callable as a standalone script

Marc Mengel <mengel@fnal.gov> -- v1.3 Oct 2000

Bugfixes for empty components (e.g. foo//bar), and adjacent wildcards (e.g. x?? y** or x?*).


FastGlob documentation  | view source Contained in the FastGlob distribution.