私はこのスクリプトを実行しましたが、現在のシェル(つまりbash)から終了しません。その後はコマンドを実行しません。
#!/usr/bin/perl
$ENV{MYVAR}="test";
exec "bash","-f";
print "End.n";
回答:
回答№1は1$ perldoc -f exec
exec LIST
exec PROGRAM LIST
The "exec" function executes a system command and never
returns; use "system" instead of "exec" if you want it to
return.