in reply to While loop wont work

You do not chomp $choice, so it is in fact "yes\n", not "yes".
Update: misread part of the code. One comment deleted.