develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #119897] glob in threads is broken in perl5.18

Thread Previous | Thread Next
Craig A. Berry
September 22, 2013 02:47
Re: [perl #119897] glob in threads is broken in perl5.18
Message ID:
On Sat, Sep 21, 2013 at 12:51 PM, Father Chrysostomos via RT
<> wrote:
> On Sat Sep 21 07:40:33 2013, Hugmeir wrote:

I have done a smoke run of smoke-me/hugmeir/dup_glob_state, results
available at:


I mention that here because unless you have the SHA1s memorized, there
is no way from looking at it that you would know what branch was
smoked.  All the failures there are also happening in blead, i.e., no
new test failures.

>> On Sat, Sep 21, 2013 at 10:56 AM, Father Chrysostomos via RT <
>>> wrote:
>> > Your test assumes that the output will be sorted, but does not even use
>> > File::Glob on VMS.  I don’t know whether the default glob on VMS
>> > produces sorted output, and whether you need to sort it.

It uses the results of LIB$FIND_FILE, documented at:


but I see no mention of sorting there.   As far as I've ever seen,
it's the order the files appear in the directory file, which on any
system I've ever worked on means asciibetically.  It's possible
different locales or local character sets could change the physical
order of the directory file, but I don't know that.  If it's important
I could try to find out.

>> >Alternatively,
>> > just ‘use File::Glob "glob"’ explicitly, and bypass the globhook
>> > mechanism (which VMS ignores) altogether.
>> >
>> Ah, I see, thanks. From the docs, I had assumed that it always gave sorted
>> output by default -- perhaps that needs updating to have a clause for VMS
>> if that's not the case. I've modified the branch to have a 'use File::Glob
>> "glob"'.
> I think perlfunc/glob needs to state that glob is not implemented via
> File::Glob on VMS.

Does perlfunc/glob really need to say how it's implemented?  To me
that implies we're not quite sure how it actually works or maybe never
decided how it should work.

>I don’t know how much of the text there about
> whitespace is applicable to VMS’s default glob, so I am not really
> qualified to write it.

On VMS, glob does not split its arguments on whitespace:

$ perl -e "print glob('*.c');"
$ perl -e "print glob('*.c *.h');"

I don't know when the split on whitespace feature was introduced but
it was probably an oversight or lack of tuits that  kept it from
getting added to the VMS implementation.

Whitespace in the pattern is assumed to be part of the filename, and
that does work:

$ create file^ with_space.txt
$ perl -e "print glob('file with*');"

where "^_" is the canonical form of a caret-escaped space character.

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