#opens counter data file again open(COUNTERDAT,">./counter.dat"); #locks file, and if can't, goes back to WRITECOUNTER flock COUNTERDAT, 2 or next WRITECOUNTER;