laziness, impatience, and hubris | |
PerlMonks |
Re: Re: Re: Locking filesby claree0 (Hermit) |
on Aug 11, 2001 at 03:10 UTC ( [id://104072]=note: print w/replies, xml ) | Need Help?? |
Ras,
Assuming that you are doing this on some sort of unix-like OS, then grepping the output of `ps ax | grep program.pl | wc -l` ought to give you the current number of running processes from that program. If 1 then it is the only instance. If 2 then another is already running, and you can exit the new instance. There may be a better way of doing this without making calls outside perl - I still talk 'perl baby-talk' quite a lot! Clare
In Section
Seekers of Perl Wisdom
|
|