Name
Data::Unique::Name - Generate a unique but stable name from a string
Synopsis
use Data::Unique::Name;
my $u = Data::Unique::Name::new(4);
ok $u->generateUniqueName("aaaa") eq "aaaa";
ok $u->generateUniqueName("aaaa") eq "aaaa1";
ok $u->generateUniqueName("aaaa1") eq "aaaa2";
ok $u->generateUniqueName("aaaa2") eq "aaaa3";
ok $u->generateUniqueName("aaaab") eq "aaaa4";
ok $u->generateUniqueName("a a a a b") eq "aaaa5";
ok $u->generateUniqueName("a-a(a)/ab") eq "aaaa6";
ok $u->generateUniqueName("bbbbb") eq "bbbb";
ok $u->generateUniqueName("bbbbbb") eq "bbbb1";
ok $u->generateUniqueName("bbbbbbb") eq "bbbb2";
Description
new($length)
Construct a new set of unique names
Parameter Description
1 $length Maximum length of generated names # File name to be used on S3
generateUniqueName($set, $string)
Generate a unique name corresponding to a string
Parameter Description
1 $set Set of unique strings
2 $string string
Index
"generateUniqueName($set, $string)" "new($length)"
Installation
Standard Module::Build process for building and installing modules:
perl Build.PL
./Build
./Build test
./Build install
Author
philiprbrenan@gmail.com
http://www.appaapps.com
Copyright
Copyright (c) 2016 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.