[Module-build-checkins] Module-Build/lib/Module/Build Authoring.pod,1.27,1.28
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <kwi...@us...> - 2005-12-04 03:48:15
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2142/lib/Module/Build Modified Files: Authoring.pod Log Message: Add docs for rscan_dir() Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Authoring.pod 2 Dec 2005 12:12:21 -0000 1.27 +++ Authoring.pod 4 Dec 2005 03:48:06 -0000 1.28 @@ -1094,6 +1094,26 @@ might be useful for writing wrapper tools that might need to chdir() back out. +=item rscan_dir($dir, $pattern) + +Uses C<File::Find> to traverse the directory C<$dir>, returning a +reference to an array of entries matching C<$pattern>. C<$pattern> +may either be a regular expression (using C<qr//> or just a plain +string), or a reference to a subroutine that will return true for +wanted entries. If C<$pattern> is not given, all entries will be +returned. + +Examples: + + # All the *.pm files in lib/ + $m->rscan_dir('lib', qr/\.pm$/) + + # All the files in blib/ that aren't *.html files + $m->rscan_dir('blib', sub {-f $_ and not /\.html$/}); + + # All the files in t/ + $m->rscan_dir('t'); + =item runtime_params() =item runtime_params($key) |