Thanks Ken, but here I forgot to mention another issue. If i apply "flock" I need to apply a shared lock in "script1.pl" and in my case its unfavourable to make any changes in that script. I can change only "script2.pl"
Thanks
AvantA
Comment on Re^2: check which files are open to write/read by another process