I'd suggest File::Find for the directory reading, and check out the -X file operators in perldoc perlop.
We're not trying to be obstructive, just to give you a little push to get past your insecurity about this. You're heading the right direction - just keep going!