See rename, split, join, length, and substr for some ideas. You may also want to see -e to check if a file or directory exists. Before using rename, you will likely want to do a test run with just printing.
--MidLifeXis
In Section
Seekers of Perl Wisdom