learning perl chapter 5 exercise