develooper Front page | perl.perl5.porters | Postings from February 2003

Re: [perl #20904] Wildcard-dependent glob output, perl 5.8.0 on Solaris 8

Thread Previous
February 12, 2003 19:44
Re: [perl #20904] Wildcard-dependent glob output, perl 5.8.0 on Solaris 8
Message ID:
"David Shivak" (via RT) <> wrote:
:Summary: glob returns initial argument string, only if no wildcards are
:present in the glob argument.  It happens in both scalar and list return

I think the problem here is one of documentation: `perldoc -f glob`
refers one to File::Glob which says that:
  Since v5.6.0, Perl's CORE::glob() is implemented in terms of bsd_glob().
.. but doesn't how it calls it. In fact, it calls the (undocumented)
File::Glob::csh_glob() instead, which does the extra argument parsing
described before calling the same internal routine as bsd_glob().

You are probably best off calling File::Glob::bsd_glob() directly,
with the particular set of flags appropriate to your needs.

An alternative is to load File::Glob and set $File::Glob::DEFAULT_FLAGS
(also undocumented, I'm afraid) to your preferred set of GLOB_* flags,
and then use glob() in the usual way.

As far as I can see, the results you are seeing are as expected for
the default settings (GLOB_CSH along with GLOB_NOCASE on certain
systems, for historical reasons of csh compatibility).

Volunteers to improve the documentation are always welcome. :)


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About