use strict; use warnings; use v5.16.0; # change any of the numbers below 305 or 1205) and it works. # it is not stack size as I've changed that with ulimit my @md = (1..305); my @mp = (1000..1205); print "market detail: ", scalar(@md), "\n"; print "market price: ", scalar(@mp), "\n"; my $path = "/tmp/x"; mkdir $path or die "making $path, $!"; foreach (@md) { open(my $f, ">", "$path/md_$_.dat"); close $f; } foreach (@mp) { open(my $f, ">", "$path/mp_$_.dat"); close $f; } chdir $path or die "failed to chdir to $path"; my @b = glob(qq{$path/mp_[0123456789]*.dat $path/md_[0123456789]*.dat}); print scalar(@b), "\n";