in reply to Re^3: Challenge: Generate a glob patterns from a word list
in thread Challenge: Generate a glob patterns from a word list

> for instance a , {a} and {{a}} are all equivalent.

Interestingly, we've found a place where Perl's glob behaves differently to the brace expansion in bash:

$ perl -wE 'say glob "{{a}}"' a $ echo {{a}} {{a}}

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^5: Challenge: Generate a glob patterns from a word list
by hippo (Archbishop) on May 06, 2021 at 10:54 UTC

    I tend to side with the shell here. Braces which don't enclose a comma are not a glob pattern (for me).


    🦛

      I disagree, behavior should be consistent.

      The glob could be constructed with a

      $str = join ",", @list

      part between the curlies

      glob "$start{$str}$end"

      and fail for @list < 2

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