in reply to Something is wrong

It's the bareword y. Just quote those strings. (see y)
if ( $key eq 'y' || $key eq 'Y' ){