Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
What I can't explain is why the list would be empty if nothing else changed.From perlop: A (file)glob evaluates its (embedded) argument only when it is starting a new list. All values must be read before it will start over. I think this explains the effect we can see: The first time in the loop, the arguments for glob are evaluated and return one file name. The second time in the loop, the arguments are not evaluated again (since the list is not "exhausted" yet). Instead, glob tries to find the next file, but there is none, and returns undef to signal this fact. On the third iteration, the arguments are evaluated again, yielding one filename.
-- Ronald Fischer <ynnor@mm.st> In reply to Re^2: glob behavior
by rovf
|
|