Can anybody tell me where i am wrong?
First you tell us why you think something's wrong. In what way does it not do what you expect?
Second, your approach is very fragile, there are several ways to call your script that will break it (for example by using relative paths, or symlinks to the script).
Consider locking a particular file instead; you should find some examples here on perlmonks with Super Search.
In reply to Re: How can i check my script is already running?
by moritz
in thread How can i check my script is already running?
by shekarkcb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |