I wouldn't store it right in the script for these reasons at least:
The most reasonable choice is probably following the KISS (Keep It Simple, Stupid) principle, storing the counter in a plaintext (easy debugging, no libraries required) file where locking prevents messy race contitions or nasty inconsistencies. Naturally the file name shouldn't be hardcoded in the source.
-- TMTOWTDI
In reply to Re: Persistent sequential transaction id generator
by trantor
in thread Persistent sequential transaction id generator
by mitd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |