#shut off website... $_sleepTime = (60 * 5); until($dbh->selectrow_array(qq{select `value` from `pagevars` where `name` = "eom_process"}) eq "ready") { sleep($_sleepTime); } # once ready then it will continue the functions until completed then turn the website back on