perl solution #28