my $db = RDBO->init_db; select records from queue where the flag = ‘F’; process ($rec); update queue set flag = ‘T’ where records =$ rec; $db->commit;