for ( [ foo => \&foo ], [ bar => sub { bar($arg) } ], ) { my ($name, $sub) = @_; $sub->() || die "Command $name did not return true!\n"; }