in reply to Proof of concept: File::Index
I had to solve this problem before, and I used the kind help of the Monks to compose a solution. You might find the following threads interesting:
This one and this one