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
From:
hv
Date:
February 12, 2003 19:44
Subject:
Re: [perl #20904] Wildcard-dependent glob output, perl 5.8.0 on Solaris 8
Message ID:
200302130346.h1D3kKm02378@crypt.compulink.co.uk
"David Shivak" (via RT) <perlbug-followup@perl.org> 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
:context.

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. :)

Hugo

Thread Previous


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