glob comes with a few caveats, such as: it doesn't include files beginning with a dot unless you specifically tell it to, e.g. <* .*>. Also, it uses certain metacharacters which one should be aware of (\*?~[]{}). See also File::Glob.
If you want to list all of the files in a single directory without subdirectories, opendir+readdir is fine for that. no_upwards() from File::Spec is helpful in getting rid of the . and .. directory entries. Otherwise, if you want to recurse into subdirectories, other monks have already shown some examples using File::Find and File::Find::Rule.
In reply to Re: Perl List files in directory
by Anonymous Monk
in thread Perl List files in directory
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |