until (! -f "$md"); #### my $limit = 99999; my $md; # Creates unique tmpfile do { #do the following $tmpname = int(rand($limit)); #$tmpname = convert to integer random number between 0 and $limit (99999) $md = "$TMPDIR/runitout_$tmpname"; #$md = "$TMPDIR/runitout_$tmpname" concatinated values of $TMPDIR (not listed) the string "/runitout_" and the value of $tmpname } until (! -f "$md"); #until file $md does not exist