Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^5: Edge case in Text::Glob

by Fletch (Bishop)
on Mar 02, 2022 at 16:29 UTC ( [id://11141752]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Edge case in Text::Glob
in thread Edge case in Text::Glob

Quoth perldoc -f glob

This operator is implemented using the standard "File::Glob" extension. See File::Glob for details, including "bsd_glob", which does not treat whitespace as a pattern separator.

Edit: point taken though; not sure what the other modules sit on top of if not the core glob.

Additionally: I'm not extremely surprised if other implementations mirror the details of the builtin glob as far as their behaviors go.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^6: Edge case in Text::Glob
by LanX (Saint) on Mar 02, 2022 at 18:06 UTC
    > Additionally: I'm not extremely surprised if other implementations mirror the details of the builtin glob as far as their behaviors go.

    Tho I don't even know how to generate a test-suite for that.

    It's mind-blowing

    • alterations can be nested
    • "nested" character classes do not exist but what are the exact escaping rules then?
    • how do you test globing on filenames which a particular file-system doesn't allow °
    • escaping of "glob-metas" must be reflected on "re-metas" and vice versa
    • how do you test that no unintened re-meta was injected, without being escaped?
    • I just noticed that Text::Glob translates {x,y} to (x|y) which means you get capture groups as a side effect.

    There is more for sure ...

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

    °) a quick test on Windows

    DB<152> open my $fh ,">", "$_" or say "ERROR:'$_' $!" for qw/~ [ ] + { } * ?/ ERROR:'*' Invalid argument ERROR:'?' Invalid argument DB<153> x <?> 0 '[' 1 ']' 2 '{' 3 '}' 4 '~' DB<154>

    see also this SO answer: what-characters-are-forbidden-in-windows-and-linux-directory-names

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141752]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-24 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found