Mega Code Archive
The getpgrp function retrieves the process group ID for a particular process
# The syntax of the getpgrp function is pgroup = getpgrp (pid);
#!/usr/local/bin/perl
$pgroup = getpgrp (0);
print ("The process group for this program is $pgroup.\n");