in reply to file lookup

You're most of the way there with the likes of File::Find::Rule at your side
use File::Find::Rule; for(find(file => name => "*.txt", in => "your_dir_here")) { ## do stuff here }
That will iterate over the filenames of all the files in 'your_dir_here' and its subdirectores with the .txt extension. See. the File::Find::Rule docs for more information on this most marvellous of modules.
HTH

_________
broquaint