in reply to
How the lines will get modified as per value of i
I am very skeptical of your problem statement.
At first, it appears the you want a subset of the input.
But then it appears that you want extra things added.
Please clarify.
Comment on
Re: How the lines will get modified as per value of i
In Section
Seekers of Perl Wisdom