Is there a way to get glob to output just the directory names but not their entire paths?
Yes. glob returns pathnames matching the pattern you give it. So if you give it ../results/*, it'll return the filenames in that directory in that format beginning with ../results/, just like the shell command find will do. So if you don't want the rest of the path, chdir into the directory first and then use glob just on the filenames:
chdir $ARGV[0] or die $!; print "$_\n" for glob '*';
Aaron B.
Available for small or large Perl jobs; see my home node.
In reply to Re^3: Most effective bash to perl for directory listing
by aaron_baugher
in thread Most effective bash to perl for directory listing
by ZWcarp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |