koolgirl,
I know your code is more about a tool to help you improve your programming than the actual functionality of your code. When you get confident in your ability to solve most problems yourself, you should probably start looking at CPAN to see if someone has already solved it for you. Consider: