Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Generate a unique IDby Ratazong (Monsignor) |
on Nov 15, 2010 at 09:33 UTC ( [id://871425]=note: print w/replies, xml ) | Need Help?? |
If your program will only run on one system you might also consider a counter stored in a file. Each time the program starts it will access the file, increase the counter and close it again. For handling concurrent runs of your program, you would just sleep(1) if/while your counter-file is locked for writing. If your programs are running on several systems you might use the IP/MAC-address in conjunction with the counter and have a counter-file on each system.... HTH, Rata
In Section
Seekers of Perl Wisdom
|
|