perl solution #32