20 May
2011
20 May
'11
6:57 p.m.
Hello all, what is the best way to do some initialization for some data on the only first run? Something like 'before sub', but it should run only on the first run of the script instance. Example of use: our $first; before sub { # if this is the first run of instance # $cache->{statuses} = ... # load some static data from DB # I can do # _load_cache() unless $first; # $first = 1; # but this is not beautiful } -- Best Regards, Nick Knutov http://knutov.com ICQ: 272873706 Voice: +7-904-84-23-130