Dir::Iterate - map/grep-style directory traversal
use Dir::Iterate; my @config_dirs = grepdir { -d } '/etc'; my @filenames = mapdir { (split '/')[-1] } $ENV{HOME}, '/usr';
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.
map
grep
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.
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.
mapdir and grepdir by default.
mapdir
grepdir
Brent Royal-Gordon <brentdax@cpan.org>, for the University of Kent.
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:
=back doesn't take any parameters, but you said =back 4
To install Dir::Iterate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dir::Iterate
CPAN shell
perl -MCPAN -e shell install Dir::Iterate
For more information on module installation, please visit the detailed CPAN module installation guide.