In this code:

BEGIN {
  use Fcntl ':flock';
  open( DATA, qq(C\:\\temp\\file.txt) )
  or die "file handle was not opened: $!";
      for my $foo (<DATA>) {
          print $foo;
      }
      flock DATA, LOCK_EX | LOCK_NB or exit 0;  
}

Is there anything more one could add to this statement
from the Cookbook:

If you use LOCK_NB and are refused a LOCK_SH, then you
know that someone else has a LOCK_EX and is updating
the file. If you are refused a LOCK_EX, then someone
holds either a LOCK_SH or a LOCK_EX, so you shouldn't
try to update the file.

thank you





       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to