+ eval { + $regex =~ s{ + (\*) | + (\?) | + ([^*?\\]+) | + (\\[\\*?]) | + (.+) + }{ + if (defined $1) { + '.*'; + } elsif (defined $2) { + '.' + } elsif (defined $3) { + quotemeta($3); + } elsif (defined $4) { + $4;Shouldn't this be quotemeta'ed as well? Otherwise "file.png" would become eqv. to "file?png".
I don't think so. If $4 is defined, it's equal to \\, \* or \?, which don't need further escaping.
-- Jakub Wilk