i dont know about being 100% bulletproof (realistically
speaking, what is?), but a combination of PID and
time (in seconds since epoch) should be reasonably
unique for almost any website... and since you're
having trouble with the uniqueness of pid's
perhaps you could play around with adding random
integers into the mix, or using a hashing algorithm
to spice things up.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Charles Maier
> Sent: Wednesday, March 14, 2001 1:06 PM
> To: Perl-Win32-Web Mailing List
> Subject: Problem with UNIQUE number... task # ($$) repeats on Novell!!!
>
>
> I have a perl script that needs a (UNIQUE for a predictable period) 7
> character ID (number.. but "numeric" not necessary).
>
> I felt that this would do it for me:
>
> #########
> $filtel = int(rand(999999));
> $filtel ="000000".$filtel.$$;
> while(length($filtel) > 7) {
> $filtel = substr($filtel,1);
> }
> return $filtel;
>
> ##########
>
> As it works out... Novell's task-numbers are already like 9 digits.. but
> they REPEAT (50 times in 100 calls ;o)). It looks like $$ is a time
> variable.. possibly a seconds counter.
>
> Does anyone have a "bulletproof" unique id generator that they would like to
> share??
>
>
> Charles Maier
> CDM Consulting Services
> http://www.cdmcon.com
> (610) 942-2726
>
> _______________________________________________
> Perl-Win32-Web mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
>
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web