That is for example, if I have a script named script1.pl and it is already running, I want the script to be able to check that it is already running and then just exit ...
Do you mean you check this script's running status from extern environment?If this script is running,you could get its pid with 'ps' command under Unix shell,then you could 'kill' that pid. If you want your script to check the status of itself when it's running,the things should be complicated.Usually the parent could know its childs is runninig or not by 'kill 0 => CHILD_PID',if the 'kill' return true,the parent know this child is running,then it could release a $SIG{INT} or $SIG{TERM} to the child (or use $SIG{KILL} by force).When the child receive one of these signals,it could exit normally (but you may know that both $SIG{INT} and $SIG{TERM} can be intercepted). That's the fact of parent terminating childs.I can't clearly know what's your meanings in fact.Do you mean you want the parent to kill itself when it find it's running?One process can't kill itself,It couldn't die unless the program logic end (or you kill it from outside).So maybe you would get a way to let the program end its logic as soon as you needed.
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>