Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Edge case in Text::Glob

by Fletch (Bishop)
on Mar 01, 2022 at 17:45 UTC ( [id://11141734]=note: print w/replies, xml ) Need Help??


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

It's explicitly noted (a couple levels deep, granted) that glob without extra flags is implicitly case insensitive for VMS and Win32.

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

Replies are listed 'Best First'.
Re^4: Edge case in Text::Glob
by LanX (Saint) on Mar 02, 2022 at 15:42 UTC

      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.

        > 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://11141734]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-18 06:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found