How we can create a Unique Id in Perl
The better way you can use this also
use UUID::Generator::PurePerl;
sub create_search_id {
my $this =shift;
my $args=shift;
my $ug = UUID::Generator::PurePerl->new();
my $uuid1 = $ug->generate_v1();
return $uuid1;
}
From here you can learn about UUID::Generator::PurePerl
Use Data::UUID to generate unique IDs:
use Data::UUID;
$ug = Data::UUID->new;
$uuid1 = $ug->create(); # Or create_str()