For example, glob '{a,b}{c,d}' doesn't returns paths at all.
use strict;
use warnings;
use 5.010;
say glob '{a,b}{c,d}';
--output:--
acadbcbd
Uhm, where's the documentation for that?
Ok, here's part of it:
In list context, returns a (possibly empty) list of filename expansions on the value of EXPR such as the standard Unix shell /bin/csh would do. In scalar context, glob iterates through such filename expansions, returning undef when the list is exhausted.
What do the curly braces do?
| [reply] [d/l] |
Its in the manual , See File::Glob for details.
The metanotation a{b,c,d}e is a shorthand for abe ace ade . Left to right order is preserved, with results of matches being sorted separately at a low level to preserve this order. As a special case {, }, and {} are passed undisturbed.
$ perl -le"print for glob shift" "abe ace ade"
abe
ace
ade
$ perl -le"print for glob shift" "see also sea shore "
see
also
sea
shore
$
| [reply] [d/l] |