in reply to object population problem

Would you please suggest me by writing the code that how can i solve this problem?

We are not here to do your homework for you. Here are some hints to get you started:

perldoc -f open perldoc -f readline perldoc -f split