The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dir::Iterate - map/grep-style directory traversal

SYNOPSIS

    use Dir::Iterate;
    
    my @config_dirs = grepdir { -d } '/etc';
    my @filenames = mapdir { (split '/')[-1] } $ENV{HOME}, '/usr';

DESCRIPTION

Dir::Iterate implements equivalents to the built-in map and grep functions which traverse directories instead of arrays. The block will be called for each file and directory below the given list of directories. It acts as a more usable layer on top of File::Find.

Functions

mapdir { ... } $path1[, $path2...]

The block is called for each file, folder, or other filesystem entity under the given path(s). The full path to the object is in $_. The return value or values of the block are collected together and returned in a list.

grepdir { ... } $path1[, $path2...]

The block is called for each file, folder, or other filesystem entity under the given path(s). The full path to the object is in $_. If the return value of the block is true, the full path will be in the list returned by the method.

EXPORTS

mapdir and grepdir by default.

AUTHOR

Brent Royal-Gordon <brentdax@cpan.org>, for the University of Kent.

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 81:

=back doesn't take any parameters, but you said =back 4