The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Catmandu::IdGenerator - A base role for identifier generators

SYNOPSIS

package MyGenerator;

use Moo;

with 'Catmandu::IdGenerator';

sub generate {
   my ($self) = @_;
   return int(rand(999999)) . "-" . time;
}

package main;

my $gen = MyGenerator->new;

for (1..100) {
   printf "id: %s\n" m $gen->generate;
}

SEE ALSO

Catmandu::IdGenerator::Mock , Catmandu::IdGenerator::UUID