On Tue, 2006-01-17 at 15:00 +0800, LUKE wrote: > But this case to bring about some guestion! Will the code influence > each other? When > muti-user visit the same recourse at the same time?
This code only seems to be reading from files, not writing to them, so there will be no interaction between processes. > Q1.How to avoid this situation?? > Need i lock file when i reading file?? You only need to use locking if you are writing to the file from one or more processes. > Q2.what is difference between FLOCK_SH and FLOCK_EX ? SH is shared and EX is exclusive. See the Perl documentation for examples of how to use flock. - Perrin