thegetpgrp函式返回PID的當前程序組。對於當前程序的程序組,PID應設定為0或應省略。如果 Perl 在未實現getpgrp(2)的機器上實現,則會引發異常。在 POSIX 系統上,PID不被接受。
getpgrp PID getpgrp
print getpgrp 0;