[tpm] Glob problem

Shlomi Fish shlomif at iglu.org.il
Fri Oct 23 13:18:19 PDT 2009

Hi Liam! (and all.)

On Friday 23 Oct 2009 20:02:10 Liam R E Quin wrote:
> On Fri, 2009-10-23 at 12:53 -0400, arocker at vex.net wrote:
> > I'm having a problem with a glob statement.
> >
> > It is perfectly valid, and returns expected results when applied to a
> > local (Windows) directory, but fails to match similar filenames in a
> > remotely connected directory.
> A common problem with using glob on a network drive is that the
> remote file system may be case sensitive.
> File::Find might work better, as you can use /i on matches...

The problem with File::Find is that it will recurse to all directories and 
sub-directories until you tell it to stop or prune it. You can probably do 
something similar with perldoc -f opendir , perldoc -f readdir and some 
File::Spec hackery (see the File::Spec->no_upwards() there). I usually prefer 
to avoid using glob() in even moderately important code, because it tends to 
break a lot, due to the fact it has shell-like behaviour. Just use readdir().


	Shlomi Fish

> Liam

Shlomi Fish       http://www.shlomifish.org/
Optimising Code for Speed - http://shlom.in/optimise

Chuck Norris read the entire English Wikipedia in 24 hours. Twice.

More information about the toronto-pm mailing list