sub recursive { ... local *helper = sub { ... helper(...) if $cond; ... }; ... helper(...); ... }