{ my $continue = 1; $_->[1]() for grep { my ($cond, $then, $break)=@$_; local $_='boz'; # This is your given $continue and $cond->() and do { $continue = !defined $break; 1} } [sub {/z/}, sub { print "Hi!\n" }], [sub {/o/}, sub { print "Oh!\n" }, 'break'], [sub {1}, sub { print "This is the default\n" }] ; }