in reply to Re: Re: Count number of lines?
in thread Count number of lines?

Yes. I is a filehandle here, and can be used as the first argument to flock, as well as others like seek.

BTW, to avoid having to remember that 2 is "exclusive lock", you can use symbolic names from the Fcntl module:

use Fcntl; ... flock(I, LOCK_EX);
See the perlfunc document for details.