in reply to Perl Programming help required

How you would solve the problem with pencil and paper? Please explain