http://qs321.pair.com?node_id=104801


in reply to Exiting eval via next: is that so bad?

Well, you should be aware of the fact that the next from within the eval jumps to the end of an enclosing loop, which might be a little bit surprising. Example:

my $var = 5; { eval {$var = 3; next}; $var = 4; } print $var; # 3 !!
The block after eval does not count as a loop block (same as do), so the loop commands next, redo and last work on the outer block. To make the eval block a loop block (so that you can redo it e.g.) double the braces like this:
eval {{ $i++; redo unless do_sth($i); }}

-- Hofmator