What is this supposed to be doing exactly? It kind of looks like you're using a perl cgi to manage some kind of audio playlist? Maybe shoutcast or something? I'd try and find a way to append this information to a playlist instead of executing whatever it is you're executing over and over again.
Cgi and sleep don't tend to go well together, because cgi is really for an execute-once and then expire kind of thing. You might want to actually have a separate server daemon that gets fed info from the cgi but always runs on its own and can handle queuing your selections ... my 2 quatloos ...