in reply to Using File::DosGlob::glob in loop only works first time

The following tests were done on Solaris, using just the standard 'glob' as opposed to DosGlob.

First, my directories

> ls -1 abc.txt def.txt xyz.boo
Now, use glob in scalar context, and it is apparent that it buffers it's output, to be sent back one at a time, regardless if it is called again with a new parameter.
> perl -e '@a=qw(*.txt xyz.boo);foreach $f (@a) {print "$f->";$y=glob( +$f);print $y,"\n";}' *.txt->abc.txt xyz.boo->def.txt
Do the same thing in list mode, and the list is 'refreshed' when a new glob is called.
> perl -e '@a=qw(*.txt xyz.boo);foreach $f (@a) {print "$f->";($y)=glo +b($f);print $y,"\n";}' *.txt->abc.txt xyz.boo->xyz.boo
That said, you don't really need to use glob unless you use wildcards.

I got bit once because I mistakenly believed that glob would always return files that only matched the inputs (with or without wildcards). In other words, the following is only true IF you use wildcards.

The first time you call glob, it returns the first filename that matches the file spec.

If there are no wildcards in the parameter passed to glob, glob will simply return the string, even if the file does not exist. Notice that 'boo.txt' is not a valid file.
> ls -1 abc.txt def.txt xyz.boo > perl -e '($y)=glob("*.txt");print $y,"\n";' abc.txt > perl -e '($y)=glob("boo.txt");print $y,"\n";' boo.txt