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:
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:my $var = 5; { eval {$var = 3; next}; $var = 4; } print $var; # 3 !!
eval {{ $i++; redo unless do_sth($i); }}
-- Hofmator
In Section
Seekers of Perl Wisdom