in reply to why not glob
in thread Quickest way to get a list of all folders in a directory
I don't use glob because it has its own syntaxt and quirks, I find this much clearer to use File::Find::Rule with regexgrep -d, glob ...
#!/usr/bin/perl -- use strict; use warnings; use File::Find::Rule; my $dir = '//pcnamevm/c$/program files/adobe/'; $dir = 'C:/program files/Mozilla Firefox/'; my @folders = File::Find::Rule->directory->maxdepth(1)->in($dir); use DDS; Dump \@folders; __END__ $ARRAY1 = [ 'C:/program files/Mozilla Firefox', 'C:/program files/Mozilla Firefox/chrome', 'C:/program files/Mozilla Firefox/components', 'C:/program files/Mozilla Firefox/defaults', 'C:/program files/Mozilla Firefox/dictionaries', 'C:/program files/Mozilla Firefox/extensions', 'C:/program files/Mozilla Firefox/greprefs', 'C:/program files/Mozilla Firefox/modules', 'C:/program files/Mozilla Firefox/plugins', 'C:/program files/Mozilla Firefox/res', 'C:/program files/Mozilla Firefox/searchplugins', 'C:/program files/Mozilla Firefox/uninstall' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Quickest way to get a list of all folders in a directory (why not glob)
by toolic (Bishop) on Aug 14, 2009 at 14:48 UTC | |
by Anonymous Monk on Aug 14, 2009 at 15:28 UTC | |
by toolic (Bishop) on Aug 14, 2009 at 16:08 UTC | |
by Anonymous Monk on Aug 20, 2009 at 01:21 UTC |