I tested the code also (how did you test it?). While the program was running, I created a file with a name ending in ".gz", and the module did not detect it. In debugging the module, I found that the same list of files was being processed over and over, without the new file ever being in the list, BEFORE the filtering even took place. I suspect it's a difference in the way
rewinddir behaves on Win32 vs. *nix (instead of opening the directory with
opendir, it just rewinds the previously opened directory handle and then reads the files again from the same handle). And if your test was valid, then maybe it also depends on the version of Windows and/or perl?