##
if (
do_each_until_false(
\&function1,
\&function2,
sub {require Foo; Foo::bar()},
\&function3,
# etc.
)
) {
print "All done\n";
}
else {
print "FAILED\n";
}
####
my $is_success = 0;
BLOCK: {
function1() or last BLOCK;
function2() or last BLOCK;
require Foo;
Foo::bar() or last BLOCK;
function3() or last BLOCK;
# etc;
$is_success = 1;
}
if ($is_success) {
print "All done\n";
}
else {
print "FAILED\n";
}