I think that 'File::Find' (or any one of several other "file finders") is definitely the best approach to use here. As the finder returns each entry to you, regular expressions can very easily be applied to the strings. Much of the troublesome complexity would be pushed out of the user's code and into the finder, along with any platform-dependent concerns.