perl solution #19