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";

Output:

PID before fork: 21314 PID after fork: 21315

(Your mileage may vary)

--
3dan