-
Notifications
You must be signed in to change notification settings - Fork 577
File::Glob::NO_CASE doesn't have effect without metacharacters #13701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From @SmylersThis is a bug report for perl from Smylers@stripey.com, File::Glob has a GLOB_NOCASE option, documented as making bsd_glob treat This can be seen on a case-sensitive file system by creating two files $ ./perl -Ilib -MFile::Glob=bsd_glob,GLOB_NOCASE -E 'say foreach bsd_glob "makefile", GLOB_NOCASE' But introducing some otherwise-pointless metacharacters by using the $ ./perl -Ilib -MFile::Glob=bsd_glob,GLOB_NOCASE -E 'say foreach bsd_glob "makefil[e]", GLOB_NOCASE' Note that [e] only matches a single letter "e", so those two patterns Passing glob a constant string without any metacharacters in it may Flags: Site configuration information for perl 5.19.11: Configured by smylers at Wed Apr 2 15:57:20 BST 2014. Summary of my perl5 (revision 5 version 19 subversion 11) configuration: @INC for perl 5.19.11: Environment for perl 5.19.11: |
From @ikegamiOn Wed, Apr 2, 2014 at 11:29 AM, Smylers <perlbug-followup@perl.org> wrote:
Treats **file names** as case insensitive. However GLOB_NOCASE doesn't have
Comparisons are only made against file names when "[]", "?" and "*" are But introducing some otherwise-pointless metacharacters by using the
1. It's not that the match was case-sensitive before the addition of the All of this is consistent with shell globing. It looks like you're trying |
The RT System itself - Status changed from 'new' to 'open' |
From @SmylersEric Brine writes:
Sorry, I don't follow. When comparing a filename with a pattern, surely
Where does the File::Glob docs say that?
Even without any metacharacters, it appears only to be returning files $ ./perl -Ilib -MFile::Glob=bsd_glob,GLOB_NOCASE -E 'say foreach bsd_glob "makefile", GLOB_NOCASE' With this, which yields no output: $ ./perl -Ilib -MFile::Glob=bsd_glob,GLOB_NOCASE -E 'say foreach bsd_glob "no_such_file", GLOB_NOCASE' It looks to me like the pattern is being compared against actual
Close. What I've actually got is a Linux server using Samba to share a Hence my desire to find a file with a particular name and any
Thank you for the suggestion. But it looks like that module is only bsd_glob with NO_CASE is however giving exactly the result I want, so Smylers |
From @ikegamiOn Wed, Apr 2, 2014 at 4:47 PM, Smylers <Smylers@stripey.com> wrote:
Glob is a string generator. Not all patterns results in comparisons.
What? The case GLOB_NOCASE present is very inconsistent with GLOB_NOCASE $ perl -MFile::Glob=bsd_glob,GLOB_NOCASE -E 'say for bsd_glob "missing", $ perl -MFile::Glob=bsd_glob,GLOB_NOCASE -E 'say for bsd_glob "missing"' Ok, I agree there's a bug here. Specifically, these two should return the $ perl -MFile::Glob=bsd_glob,GLOB_NOCASE -E 'say for bsd_glob $ perl -MFile::Glob=bsd_glob,GLOB_NOCASE -E 'say for bsd_glob I don't know whether they should both return "mooooooooooo" (no file system |
From @jkeenanOn Fri Apr 04 07:03:47 2014, ikegami@adaelis.com wrote:
Discussion in this RT petered out about 5-1/2 months ago. Suggestions as to how to move forward are welcome. Thank you very much. -- |
From @cpansproutOn Tue Sep 23 18:18:17 2014, jkeenan wrote:
This is a tough one. Some of us regularly use glob for things other than file globbing. <foo{1,2,3,4}> is another way of writing map("foo$_",1..4). Whether GLOB_NOCASE should change this I suppose is the question. We do have -e for the other use case (checking for files case-insensitively), but it depends on the case-sensitivity of the file system (which I suppose is a good thing). -- Father Chrysostomos |
Migrated from rt.perl.org#121566 (status was 'open')
Searchable as RT121566$
The text was updated successfully, but these errors were encountered: