in reply to Re: Re: Re: Re: Re: Perl script crashing at lockfile ?
in thread Perl script crashing at lockfile ?

In that case you have to assume that there are other processes that need this lock info.

The lockfile is used for online orders, and there is a one record file, called .SEQ that contains the next order number. Potentially, many users could be trying to order at once, and this part of the process appears to:

* Open the lockfile

* if 'successful', then open the .SEQ file to obtain the order #

* Calculate var $outfile

* increment the order #

* Close .SEQ with the next order # value

* Unlink the lockfile

So, if the "locking" works perfectly, the process has a unique value for the order, of the format "2003-10-01-0001130". Thanks for the code, to use flocking a file handle. I will add it as a sub routine, and add any extra 'headers' (I don't know what you call the code after the shebang line).

Thanks,

Peter

  • Comment on Re: Re: Re: Re: Re: Re: Perl script crashing at lockfile ?