On Thu Jul 03 08:47:45 2008, ed wrote:
> Thanks for fixing the doc.
>
> As for glob('*.c *.h'), this convenience could be given just as well by
> allowing glob() to take more than one argument:
>
> glob('*.c', '*.h')
>
> or if you prefer
>
> glob(qw(*.c *.h))
>
> At least then perl can know you really wanted two separate patterns and
> not one pattern with a space in the middle. Spaces in filenames are
> really quite common these days (even on Unix-like systems - any Mac
> users here?).
>
> Perl programs do tend to suffer bugs in handling filenames with spaces
> in, and this is one of the causes. Better to give a warning and
> encourage people to use bsd_glob() instead, or use the suggested new
> feature of multi-arg glob() if they really did intend two different
> patterns.
While I’d like to make File::Glob’s new :bsd_glob export make glob()
accept a list, there are problems with the special magic attached to the
glob keyword that prevent the prototype from changing.
If we can change that with perl 5.16, I’ll go head and make :bsd_glob
support that.
I’m going to mark this as resolved, since the glob documentation in
perlfunc has been expanded recently by Tom Christiansen to warn about
spaces more clearly and recommend quotation marks (a91bb7b11).
--
Father Chrysostomos