This one just came up: How do I break out of an if
statement? I have a long if statement, but there is one situation where I can break out of it early on.
In
You can use basic block which is subject to last
, next
and redo
, so there is possible break from it.
if ($condition) {EXIT_IF:{
last EXIT_IF; # break from code block
print "never get's executed\n";
}}
EXIT_IF: {
if ($condition) {
last EXIT_IF; # break from code block
print "never get's executed\n";
}
}