It appears after looking at other questions you have asked as well as this one that you have a bad habit of not providing any code indicating the attempts you have made and the problems you have been having. Rather than asking for examples of how you can do this, show us what you have tried. It appears that you are expecting us to write code for you based on your requirements, perlmonks is not a code writing service.