in reply to Bowling Handicaps

I see way too many my declarations here. You should leave my out of your if blocks. my creates a new lexical variable, while what you want is to access one defined one level up.