in reply to How to show all possible replacements?
Does speed really matter? If you're only going to run this once, then understanding the code is much more important.
If it's slow in real terms, then you must be processing lots of data, so I assume you'll generate lots of alternative strings. But what are you really looking for ? There may be better ways to solve your underlying problem.
Anyway, glob is one simple way to get a list of alternatives. The help says :-
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 fruit +s and colors: @many = glob "{apple,tomato,cherry}={green,yellow,red}";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to show all possible replacements?
by BurningBeard (Novice) on May 12, 2013 at 15:01 UTC |