サブルーチンから抜け出す最も良い方法は何ですか&スクリプトの残りの部分の処理を続行しますか?サブルーチンの中断
サブルーチンのためにされて戻っての明白な最善の方法を述べるの犠牲に
#!/usr/bin/perl
use strict;
use warnings;
&mySub;
print "we executed the sub partway through & continued w/ the rest
of the script...yipee!\n";
sub mySub{
print "entered sub\n";
#### Options
#exit; # will kill the script...we don't want to use exit
#next; # perldoc says not to use this to breakout of a sub
#last; # perldoc says not to use this to breakout of a sub
#any other options????
print "we should NOT see this\n";
}
'return'の何が問題なのですか? –
私は知らない...それはそれが行われるはずの方法ですか? –
+1匿名:) –