$$ 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)
--In reply to Re: PID after fork && exit
by edan
in thread PID after fork && exit
by neilwatson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |