repo.or.cz
/
xrzperl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
updated git and svn scripts
[xrzperl.git]
/
uniqname
blob
be4b6acbf3cfc0a4617433a757e3a050d8d1cf9b
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
);
11
}
12
print
(
Uniqname
(
shift
),
"
\n
"
);
13