develooper Front page | perl.beginners | Postings from November 2003

Re: Glob and space in directory name

Thread Previous | Thread Next
From:
Rob Dixon
Date:
November 27, 2003 04:07
Subject:
Re: Glob and space in directory name
Message ID:
20031127120623.33664.qmail@onion.perl.org
David --- Senior Programmer Analyst --- Wgo Wagner wrote:
>
>
> Note: I went into File::Glob and it gives the following:
>
> Since v5.6.0, Perl's CORE::glob() is implemented in terms of
> bsd_glob(). [...] Due to historical reasons, CORE::glob() will also
> split its argument on whitespace, treating it as multiple patterns,
> whereas bsd_glob() considers them as one pattern.
>
> So I did the following:
>
> use File::Glob qw(:globally :glob);

That's exactly right Wags. As the POD says, CORE::glob uses bsd_glob
but additionally splits its parameter on whitespace. It's those pesky
historical reasons again.

  use File::Glob ':glob';

(you don't need the ':globally' unless you're on pre-5.6.0) overrides
CORE::glob to do call bsd_glob but without the fancy parameter
splitting.

Cheers,

Rob



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About