Dunnigan,Jack [Edm] wrote:
> Why use 'seek' at all? You have already opened the file in 
> 'append mode' which should bring you to the bottom of the file.

Look at `perldoc -f flock` -- it uses the seek in its example, too. It's
supposedly to guard against somebody else appending to the file between the
time you open for appending and the time you finally acquire the lock. So
the code seek()s after flock()ing to make sure you're really at the end of
the file, not just where the end of the file used to be.

> The '2' in flock may depend on what system you are on. It 
> generally means 'exclusive' lock.

Yes. See perldoc -f flock, again. It also talks about Fcntl.pm, which will
give you constants such as LOCK_EX.

> Also, I usually use the 'each' function to iterate through a hash...

Although this means you need a superfluous variable $mykey, since the OP is
apparently interested in the values. He could have used foreach $value
(values %form) { print DATA $value:"; } instead of looping over keys %form,
but I wouldn't recommend each %form *in this situation*.

Cheers,
Philip

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to