in reply to Removing glob
Keep in mind that glob($dir . '\\files\\*.txt'); will fail if $dir includes characters special to glob, such as space.
You'd be better off using bsd_glob from File::Glob directly instead of using it via glob. Then, spaces won't be a problem. Other special characters won't cause any harm since they're not found in file names.
There's also the issue that glob acts very specially in scalar context. If you want the first file returned by glob, use ($file)= instead of $file=. If you don't, subsequent calls to glob will return "odd" results.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Removing glob
by Anonymous Monk on Feb 19, 2011 at 08:18 UTC | |
by Corion (Patriarch) on Feb 19, 2011 at 08:25 UTC |