功能的"最后"操作符?

San*_*ing 5 perl

Perl是否有操作员退出函数或last函数?

sub f {

    # some code here

    if ($v == 10) {
    # goto end of function/exit function/last
    }

    # some code here
}
Run Code Online (Sandbox Code Playgroud)

A goto可以做到这一点,但它以某种方式接缝错了?

Mat*_*aly 16

使用return;退出子程序.