develooper Front page | perl.perl5.porters | Postings from October 2015

Re: [perl #126271] File::Glob issue

Thread Previous
From:
Paul Johnson
Date:
October 13, 2015 21:10
Subject:
Re: [perl #126271] File::Glob issue
Message ID:
20151013211002.GB19729@pjcj.net
On Tue, Oct 06, 2015 at 09:53:45PM +0100, Zefram wrote:
> Ed Avis wrote:
> >Out of interest why does glob-via-shell still exist?
> 
> Historical.  I think it was meant to be the lazy way to get globbing,
> but given that Perl already has a serviceable pattern-matching engine,
> and the embuggerance involved in getting the shell thing to work, it's
> probably not saving code any more.
> 
> I think it would be a good idea to move to always performing the
> globbing ourselves.  The only trickiness in doing so is concerned
> with having the code located in File::Glob: miniperl needs to be able
> to glob without loading XS.  The critical code from File::Glob would
> have to be present in the core proper, and there's then a choice to be
> made as to whether File::Glob (to implement its distinctive interfaces)
> should have a duplicate of that code or attempt to use the core's copy
> (presumably via a new core API function).

A long time ago (probably last millennium) someone (probably Chip)
discussed the possibility of nicking the zsh globbing code and using
that, along with the extended globbing syntax.

Not sure how feasible that is, but I do wish it were possible every time
I write something horrible like:

  my @files = split " ", `zsh -c 'echo **/*.pm'`;

-- 
Paul Johnson - paul@pjcj.net
http://www.pjcj.net

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