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

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

Thread Previous | Thread Next
October 6, 2015 17:25
Re: [perl #126271] File::Glob issue
Message ID:
Karl Williamson wrote:
>                     One solution I thought of (that Zefram) doesn't
>like is for F:G to fork a shell if and only if it finds a shell

That would mean that it would acquire the newline misbehaviour,
and equivalent misbehaviour on semicolon and other metacharacters.
That is not a desirable feature of the glob-via-shell mechanism, it's
a problem to be avoided.  We should prefer to bring the two globbing
mechanisms into synchrony by tweaking the glob-via-shell code to escape
non-globbing metacharacters.

A problem with this is that the globbing mechanism might be intentionally
used to get types of shell expansion other than globbing, such as
parameter expansion and command substitution, which don't interfere
with the glob-via-shell framework.  In the general case these are
shell-specific, and can contain arbitrary embedded shell commands,
so it's impossible to distinguish metacharacters that are part of
these acceptable constructions from metacharacters that will break the
framework.  But these uses have already been broken by the File::Glob
implementation, so it should be fine to break them in the glob-via-shell
implementation too.


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