You may want to chomp (my $answerinfect = <>); because otherwise it would contain "entered_answer\n". Does this give you any warnings?
What scope does the $j variable belong to? Did you try last instead of setting variable?
In reply to Re: infinite loop does not stop
by aitap
in thread infinite loop does not stop
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |