Execute a function on each module in a directory