while ( -s $SEMAPHORE ) { print STDERR "lock found waiting\n" if $debug > 10; sleep 5; }