Add solution to challenge 22 (perl)