in reply to Re^4: File::Glob infinate loop with while loop unlike core glob function
in thread File::Glob infinite loop with while loop unlike core glob function
ext/File-Glob/t/global.t
they appear to be doing extensive testing to make sure a glob overload behaves in the same way as the core glob, including loops using <> and explicit invocations of glob. If I modify global.t as follows
I get4,5c4 < chdir 't' if -d 't'; < @INC = '../lib'; --- > chdir '/home/jpl/src/perl-5.14.1/t'; 94a94,111 > > @s = (); > while (glob("/tmp/dir with spaces/*")) { > push @s, $_; > last if (@s > 1000); > } > print(scalar(@s), "\n"); > print(join(" ", @s), "\n"); > > package Bar; > use File::Glob ':glob'; > @s = (); > while (glob("/tmp/dir with spaces/*")) { > push @s, $_; > last if (@s > 1000); > } > print(scalar(@s), "\n"); > # print(join(" ", @s), "\n");
at the end of the output (the directory has 3 entries). It's above my pay grade to figure out why this happens, or how to make the replacement using :glob behave as core glob does, but I'm running out of arguments why the current behavior is correct. Your suggestion of a new tag to get this behavior seems reasonable.2 /tmp/dir with 1001
|
|---|