http://www.perlmonks.org?node_id=999311


in reply to Re: glob quietly fails
in thread glob quietly fails

As remiah and Anonymous Monk have stated, I expected while and for to behave the same way, and they do for me, on Strawberry Perl v5.16.1:
#!/usr/env/perl use strict; use warnings; my $q = (shift or 129); # 128 is the largest working value my @x = ( 'A' x $q, 'B' x $q ); my $glob = '{' . join(',', @x) . '}'; while (my $g = glob($glob)) { print "while: $g\n"; } for my $g ( glob( $glob ) ) { print "for: $g\n"; } __EOF__ ################# # result: # while: for:

Running this with a command line argument of 128 gives the expected output of 2 very long strings for while and 2 for for.

-QM
--
Quantum Mechanics: The dreams stuff is made of