in reply to Getting PID and Process Name

Unless you are trying to find out the name of the script from another script, your script can do something like:
open PID, '>', "$0.$$" or die "can't write pid file: $!";
$$ is the current process id and $0 is the name of the script.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)