My 2 cents.  

I would prefer that glob, being a core function, be as close as possible in
semantics between VMS and other systems.  This will ease, but not eliminate
issues with, portability of Perl code between VMS and other systems.

Of course, glob() on VMS being based on lib$find_file() does mean that the
semantics are different, but note that the workarounds you mention will work
when perl code running on VMS is ported directly to other systems (modulo the
VMS directory/file semantics itself).  The VMS directory/file semantics are
issues that jump out at a potential porter, the filename/wildcard list are less
obvious, I think.

If a f$search-like capability is desired, then a VMS:: module should probably be
instituted that includes this capability.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Saturday, December 06, 2003 2:05 PM
> To: Craig A. Berry
> Cc: [EMAIL PROTECTED]
> Subject: Re: Access violation from humongous "glob" call
> 
> 
> 
> 
> 
> "Craig A. Berry" <[EMAIL PROTECTED]> wrote on 12/06/2003 12:14:51 PM:
> 
> > Well, doh, the magic number is (as I should have realized) 127.  I
> > just had a hard time believing we've never had the result of a glob
> > longer than that.  Here are the length values we are actually using
> > as we approach and pass 127:
> 
> Craig,
> 
> While you are in looking at that section of code I'd like to point out
> that
> I've had requests to make vmsperl's glob() as useful as either DCL's
> DIRECTORY command or DCL's F$SEARCH() lexical function.
> In particular this construct:
> 
>    my @c_and_h_files = glob("DEV:[BIGDIR]*.c,*.h");
> 
> does not work as users of:
> 
>    dir dev:[bigdir]*.c,*.h
> 
> would expect it to.  Alternatives include the workaround of calling:
> 
>     my @all_files = glob("DEV:[BIGDIR]*.*");
> 
> and filtering @all_files in perl, or to glob across BIGDIR twice as in:
> 
>    my @c_files = glob("DEV:[BIGDIR]*.c");
>    my @h_files = glob("DEV:[BIGDIR]*.h");
>    my @c_and_h_files = (@c_files,@h_files);
> 
> Both of which seem to perform poorly when BIGDIR truly has a
> lot of files in it.
> 
> So perhaps there is a better way to handle the arguments
> to perl's glob() in an even more VMS friendly way since we have
> already eschewed the BSD style glob compatibility to call
> lib$find_file().  I just wanted to mention the possibility at this time.
> 
> Peter Prymmer

Reply via email to