Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Multiple Permutation handling

by Laurent_R (Parson)
on Mar 02, 2013 at 22:20 UTC ( #1021462=note: print w/ replies, xml ) Need Help??


in reply to Re: Multiple Permutation handling
in thread Multiple Permutation handling

Hello dear Perl Monks,

On a cross-post of the same question by the OP on the DevShed forum, I answered with a suggestion almost identical to Toolic's nested foreach loops.

However, this use of the glob function puzzles me. After some tests and reading in detail the glob description, I found this passage: "If non-empty braces are the only wildcard characters used in the glob, no filenames are matched, but potentially many strings are returned. For example, this produces nine strings, one for each pairing of fruits and colors".

So, now I understand why glob is being used in this context, but can anyone tell me why glob is doing this sort of things, which seems to have little to do with the normal usage of glob (by "normal", I just mean the usage that I have been knowing for years, i.e. returning filename extensions or a list of filename matching a shell file pattern)?


Comment on Re^2: Multiple Permutation handling
Re^3: Multiple Permutation handling
by choroba (Abbot) on Mar 02, 2013 at 22:24 UTC
    In some shells, brace expansion is part of the filename patterns.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Thanks, I get the point now.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (18)
As of 2014-12-18 14:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (53 votes), past polls