$path="e:\\var\\www\\lars\\io\\"; $TimeOutMinutes = 5; $debug = 0; $filenr = 0; $NewFilename=""; $ext=""; binmode STDIN; srand(time()^($$+($$<<15))); $user_input = read(STDIN, $Buffer, $ENV{CONTENT_LENGTH}); open DBG, ">$path" . "debug.trc" if $debug; print DBG $Buffer if $debug; close(DBG) if $debug; $exists = 1; $last = int(rand(99999)) + 1; while($exists != 0) { $last = int(rand(99999)) + 1; $name = $path."h".$last.".in"; if(open(TESTDAT, $name) != 0 ) { close(TESTDAT); $exists = 1; } else { if ( open(TESTDAT,$path."h".$last.".tmp") != 0 ) { close(TESTDAT); $exists = 1; } else { open(LARSOUT, ">".$path."h".$last.".tmp"); $exists = 0; } } }