stupidius has asked for the wisdom of the Perl Monks concerning the following question:

Greetings and salutations monks. I am stupidius, of the clan, Stupid. I am sent forth to you today to seek your wisdom in the matter of the flock function. Several scripts on mine website may run simultaneously, and they may requireth access to a certain file for reading and/or writing. What is the proper way to flock a file so that if that certain file is needed, the calling script will wait for it to be released if it is locked? I do not merely wish to lock it and have other scripts return errors, but rather, have each one wait there turn. I thank thee in advance, and my apologies for my poor rendition of Ye Old English. Johnius Stupidius of the Stupid Clan