in reply to
Repeating the same command in different portions of input
By the way,
perlintro
is a good reading for beginners, and its section
Conditional and looping constructs
contains basic informarion about loops in Perl.
Sorry if my advice was wrong.
Comment on
Re: Repeating the same command in different portions of input
In Section
Seekers of Perl Wisdom