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.
In reply to Re: Removing glob
by ikegami
in thread Removing glob
by perl_mystery
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |