updated git and svn scripts
[xrzperl.git] / uniqname
blobbe4b6acbf3cfc0a4617433a757e3a050d8d1cf9b
1 #!/usr/bin/perl -w
2 sub Uniqname($);
3 sub Uniqname($) {
4 my $ext = $_[0] ? $_[0]: "";
5 my $max = 10000000000;
6 my $n1 = int (rand($max));
7 my $n2 = log($max / $n1)/log(10);
8 my $result=$n1 . "0"x$n2 . $ext;
9 return $result unless(-f $result);
10 return Uniqname($ext);
12 print(Uniqname(shift),"\n");