(sub get_number {
open(NUMBER,">>data.txt");
flock (NUMBER, 2);

Do blah blah blah

close (NUMBER);

closing a file automatically removes the lock?? or should I have to unlock it by 
placing

flock (NUMBER, 8);
close (NUMBER);

My second question is how I can delay the execution of a script (If two users trying 
to execute the same script) for 30 sec by using sleep function? and If I implement 
sleep function in my script ..... Do I really need to use 'flock' in my script or 
there is no need then.

Thanks.

 

Reply via email to