in reply to PID after fork && exit
$$ will always give you the current process ID:
print "PID before fork: $$\n"; fork && exit; print "PID after fork: $$\n"; [download]
Output:
PID before fork: 21314 PID after fork: 21315 [download]
(Your mileage may vary)