in reply to opening directories in perl

Take a look at the File::Find module.