You'll have to check for another process and exit if one is running. It can easily done if you use a lock file. If your script doesn't crash just check for the file and run or not. Also you can parse the output of ps for the name of your program. > -----Original Message----- > From: Michael D. Kirkpatrick [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 28, 2000 9:16 AM > To: [EMAIL PROTECTED] > Subject: [expert] Multiple Processes > > > Is there a way to mark a perl script to be ran as a single > process only? > > The problem: > I have a perl script that takes 3-5 seconds to run (Very > large databases) > If I mess up and double click on the submit button, a second > process is > spawned off. This completely slows down the first process > and takes twice > as long to process. As for a test, I clicked the submit > button 20 times > and it spawned off 20 processes and totally slowed down the > server for a > long while. > > I want the server to reject the script from running more then > 1 process. > Is this a perl thing where I have to encode in the script to check for > other copies being ran? Or is there an access right that can > be set where > it only allows 1 copy to be ran? > > This is not a public script. There are 5 people that access > this script on > a regular basis. > > Thanks in advance. >
