Works for me if I use a metacharacter so there's a dynamic pattern rather than a fixed string to match against. However, I generally prefer Path::Tiny for anything even slightly complex in this regard. Here are both approaches illustrated:
#!/usr/bin/env perl use strict; use warnings; use autodie; use Test::More tests => 2; use File::Glob qw( :globally :nocase); use Path::Tiny; open my $foo, '>', '/tmp/MisterPerl'; print $foo "Yeah!\n"; close $foo; my (@f) = glob ('/tmp/misterper[l]'); is $f[0], '/tmp/MisterPerl', 'File found case-insensitively with File: +:Glob'; @f = path ('/tmp')->children (qr/^misterperl/i); is $f[0], '/tmp/MisterPerl', 'File found case-insensitively with Path: +:Tiny';
Meta note: this node was apparently posted OK but not attached to the thread and then the content disappeared (see Re: Missing 'in reply to...' And 'in thread....'). I've restored the content now.
In reply to Re: Can I get help with Perl glob for filtering a directory
by hippo
in thread Can I get help with Perl glob for filtering a directory
by misterperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |