[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Porters] globbing



At 08.36 +0000 1999.12.30, Bart Lateur wrote:
>On Wed, 29 Dec 1999 05:55:15 -0500, Scott R. Godin wrote:
>
>>does anyone know offhand whether the current version of MacPerl (I just got
>>the "Power and Ease" book :) has been updated to include full globbing
>>patterns such as [a-zA-Z] etc  ? or is it still just * and ?
>
>File globbing is supposed to be shell-compatible. That is pretty
>meaningless for MacPerl (unless you count on LWP), but on other
>platforms, shell globbing is based on '*' and '?'. So it is very
>unlikely that it will EVER change.

perl 5.6 (and by extension, MacPerl based on 5.6) will have File::Glob
built-in, which can be (I think it is a compile-time switch) set to be
automatically invoked whenever glob is called.  File::Glob does globbing
based on the BSD glob.c semantics, and (if the current code stays as it is)
it will be, by default, case-insensitive on platforms where the native fs
is case-insensitive (Win32, Mac OS, etc.).

This sounds nice, except that it very well could break old code that
depends on MPW semantics that won't be included in File::Glob.  It will be
a decision for Matthias: either to have glob() automatically invoke
File::Glob, or to require the user to invoke File::Glob manually.  I think
I would vote for the latter, even though it would break old code, and then
offer a Mac::Glob module or something that would provide the old semantics.
This would make future users of glob() get the least surprising behavior
(IMO), and allow old code to work with the addition of just one line of
code.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-porters-request@macperl.org