if( not $thread){ # Send a message to the user in some way... print"No record found for thread number: $id"; # Get out of the structure in some way... exit; }