The stupid question is the question not asked | |
PerlMonks |
Re: File::Glob infinate loop with while loop unlike core glob functionby jpl (Monk) |
on Jul 29, 2011 at 17:44 UTC ( [id://917505]=note: print w/replies, xml ) | Need Help?? |
No, I don't think it is a bug. glob returns a list. In scalar content, as while establishes, you just get the last element of the list. In this case, it is a non-empty string, so it acts as true, and it never changes, so there is an infinite loop. If you do
the list, in array context, turns into a real array, over which you can iterate with your favorite iterator.
In Section
Seekers of Perl Wisdom
|
|