Craig A. Berry wrote:

On Jan 19, 2009, at 9:05 PM, John Malmberg wrote:

In investigating a failure of lib/Module/Build/t/compat.t, I discovered that it was because glob() was behaving differently.

glob('foo') on vms is interpreted as glob('foo.*') would be on Unix.

That's pretty much what would be expected from native utilities. For example,

$ dir foo

Directory D0:[CRAIG.TEST]

FOO.-ORIG;1         FOO.BAR;1           FOO.C;7             FOO.COM;25
FOO.CXX;5           FOO.DIR;1           FOO.H;4             FOO.LIS;4
FOO.MMS;5           FOO.OBJ;1           FOO.PATCH;1         FOO.TMP2;1
FOO.TXT;4

Total of 13 files.

Yes, and the documentation indicates that glob does an expansion the way that the shell does. Of course, on VMS, the DCL shell does not do the expansion, the utilities do.

As a result, the clean target is incorrectly deleting 'foo.PL' when it was requested to delete 'foo', along with deleting 'foo'.

Last time I checked, I thought it was because something was deleting *.pl and assuming a case sensitive file system so *.PL got deleted as well.

I had that test working before this last update of Module::Build, so either I missed something, or something changed.

Now specifically it is using glob to expand the passed filespec, and doing a delete on all the files returned.

And even worse, if 'foobar' is a directory, glob('foobar') on VMS is treated as if it were glob('foobar/*') on Unix. And it does not matter if it is specified as glob('[.foobar]'), glob('foobar.dir'), or glob('foobar/'), it still is treated as if it were glob('foobar/*') on a Unix system.

In the case of a file, this appears that it may be an oversight in the implementation. In the case of the directory, code has been specifically added to cause this behavior.

I am trying to figure out what the fix should be.

I'm not sure either. Things have been the way they are for a very long time, quite possibly since before any standards emerged for glob or fnmatch.

If we do not change the VMS behavior, then we have to special case the code in Module Build for VMS.

Tonight, I am running a test of perl modified to what should be the Unix behavior, except that if a VMS format directory is passed with out a filename, the old behavior will occur.

This will see if there are any tests expecting the old behavior on VMS.

The old behavior can be restored with a logical name PERL_VMS_OLD_GLOB being defined to "ENABLE".

-John
wb8...@gmail.com

Reply via email to