There is an ongoing outage on the primary CPAN mirror. It is possible to work around the issue by using MetaCPAN as a mirror.

FUNCTIONS

unique

set up a generator:

my $id_generator = unique(sub { int rand 1000 });

get a random unique id from this generator:

$id_generator->();