perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

[doc] File::Glob document [!...] for negated character class

Open kberry opened this issue 1 year ago • 0 comments

Where

File::Glob

Description

I suggested documenting that negated character classes must be specified with [!...], and [^...] does not work. Perhaps simply by adding a line:

  [!...] negated character class (not [^...])

to the "META CHARACTERS" section.

Now, I could find no clear documentation on negated character classes in Perl's File::Glob. It merely says Perl's glob is implemented in terms of freebsd's glob. The documentation for freebsd glob (https://man.freebsd.org/cgi/man.cgi?glob(3)) does not describe the user syntax at all, but (silently) refers to sh (https://man.freebsd.org/cgi/man.cgi?sh(1)), which, under "Shell Patterns", says that both ! and ^ are supported, though ^ is "non-standard".

Thus, a Perl user would have no way to guess that [^...] is not supported by Perl. And since there is (and can be) no error message when ^ is used, the only way is by deduction from experiment. So explicit documentation would be nice. Thanks.

kberry avatar Jan 22 '24 18:01 kberry