Eli the Bearded <*@eli.users.panix.com> wrote:
In comp.lang.perl.misc, gamo <[email protected]> wrote:
my $b1 = join(",", 1..1000);
my $b2 = join(",", "a".."z");
my @B = glob "{$b1}={$b2}";
my @C;
for (@B){
@C = split /=/;
say "@C";
}
...
This does not works as I expected because if I change 1000 by 10000
nothing is printed. Somewhere I reach an unexpected limit.
Um, don't do that? The glob function is specifically for filenames
and using it in other ways I suspect is not well supported. I'm going
to guess your "unexpected limit" is the ARG_MAX value in limits.h.
perldoc -f glob says "see File::Glob" and perldoc File::Glob talks
about the various limits.
At least for my rather old v5.16.3 "perldoc -f glob" also 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 fruits and colors:
@many = glob "{apple,tomato,cherry}={green,yellow,red}";
So "other ways" than filenames are at least minimally supported.
--
/* * * Otto J. Makela <
[email protected]> * * * * * * * * * */
/* Phone: +358 40 765 5772, ICBM: N 60 10' E 24 55' */
/* Mail: Mechelininkatu 26 B 27, FI-00100 Helsinki */
/* * * Computers Rule 01001111 01001011 * * * * * * */
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)