# check for semaphore file my $data_dir = "C:/data"; my $semaphore = "$data_dir/inprocess.txt"; die "another process is in progress" if -f $semaphore; # create the semaphore file open SEMAPHORE, ">$semaphore" or die "Can not create semaphore"; close SEMAPHORE; # do the processing... # delete the semaphore file at the end # you could put this bit in the END block. unlink $semaphore; #### Please be patient while the report is being generated. This process may take more than 2 hours to complete. You can still refer to the most recent report while the new report is being created.