1. How to read command line arguments in to the program.
2. How to read file
3. Merger them up.
Always use , use strict and use warnings at the beginning of your script.
Oops!! It seems I repeated the same suggested by Sergei !!
Delay leads to duplication