[sf-perl] matching digits in braces in globs
yary
not.com at gmail.com
Wed Jun 18 08:51:03 PDT 2008
Other test cases- I think these should all return "f23"
$ touch f23
$ perl -de 1
...
DB<1> p <f*>
f23
DB<2> p <{f*}>
f23
DB<3> p <f[0-9][0-9]>
f23
DB<4> p <{f[0-9][0-9]}>
DB<5> p <f{[0-9][0-9]}>
DB<6> p <f{[0-9][0-9]}*>
f23
DB<7> p <{f[0-9][0-9]}*>
DB<8> p <{f[0-9][0-9]*}>
DB<9> @n = <f*> ; print $n[0]," L=",length $n[0]; # be sure no hidden char
f23 L=3
$ perl -de 1 '-MFile::Glob(bsd_glob)'
...
DB<1> p bsd_glob('f*')
f23
DB<2> p bsd_glob('{f[0-9][0-9]}')
DB<3> p bsd_glob('{f[0-9][0-9]}',GLOB_ERR); print "\nerr=$!";
err=
DB<4> p bsd_glob('{f[0-9][0-9]}',GLOB_LIMIT); print "\nerr=$!"
err=
I checked the tests in File/Glob/t and there's only test a simple case
for brackets {a,b}- no cases with special characters inside the
braces.
It looks like a bug to me. Not completely sure though.
More information about the SanFrancisco-pm
mailing list