in reply to Re: File::Glob infinate loop with while loop unlike core glob function
in thread File::Glob infinite loop with while loop unlike core glob function
No, I don't think it is a bug. glob returns a list
This is the bug, that it returns a list in scalar context, and the docs don't warn about it.
perldoc -f glob says
In list context, returns a (possibly empty) list of filename
expansions on the value of EXPR such as the standard Unix shell
/bin/csh would do. In scalar context, glob iterates through such
filename expansions, returning undef when the list is exhausted.
use File::Glob ':glob'; overrides glob (csh_glob) with a function that behave differently in scalar context (bsd_glob), and the documentation dosn't warn you explicitly.
Beginning with v5.6.0, this operator is implemented using the
standard "File::Glob" extension. See File::Glob for details,
including "bsd_glob" which does not treat whitespace as a
making bsd_glob DWIM in scalar context is trivial (just copy/paste from csh_glob)
fixing the pod is equally trivial.
No, I'm not contemplating filing a bug report, Gulliver should :)