in reply to Re: Globbing uncertainty
in thread Globbing uncertainty
In my experience, readdir is almost never what you want. Use glob. Really, it's much easier, and it keeps the full pathname that is fed to it. Your @files array will hold only the filenames, not $path_to_dir. In order for it to be useful, you almost always will need to concatenate $path_to_dir to each item in the array anyway. Since that is probably the case, just use glob and the list you get back will already have the pathname in there, and the values will be useful immediately.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Globbing uncertainty
by Marshall (Canon) on Nov 11, 2010 at 20:58 UTC | |
by Anonymous Monk on Nov 11, 2010 at 23:48 UTC |