I tried a simplified version of what you had before and it works every time on my XP laptop. Found in Programming Perl that it is supposed to return false (only once) when it gets to the end of the matching files and then start over.
At least you now have an array of what the glob is doing. I couldn't get the glob to work with $FOLDERNAME in the glob but with the path spelled out it worked fine. The book mentioned something about only one level of interpreting variable but I didn't quite get it.