Catman...::UUID(3pm)
π Catmandu::DirectoryIndex::UUID π
okay so bestie, this page is Catmandu::DirectoryIndex::UUID(3pm), straight out of the User Contributed Perl Documentation collection, and it's giving "tiny module, big opinions about where your files live." Let's get into it π«Ά
β¨ NAME β¨
Catmandu::DirectoryIndex::UUID β a uuid based path translator. that's it, that's the whole job, and it does it flawlessly π
πΈ SYNOPSIS πΈ
use Catmandu::DirectoryIndex::UUID;
my $p = Catmandu::DirectoryIndex::UUID->new(
base_dir => "/data"
);
# Returns mapping like { _id => "9A581C80-1189-11E8-AB6D-46BC153F89DB", "/data/9A5/81C/80-/118/9-1/1E8/-AB/6D-/46B/C15/3F8/9DB" }
# Can be undef
my $mapping = $p->get("9A581C80-1189-11E8-AB6D-46BC153F89DB");
# Create path and return mapping
my $mapping = $p->add("9A581C80-1189-11E8-AB6D-46BC153F89DB");
# Catmandu::DirectoryIndex::Number is a Catmandu::Iterable
# Returns list of records: [{ _id => 1234, _path => "/data/000/001/234" }]
my $mappings = $p->to_array();
like look at that. you hand it a UUID, it hands you back a whole little nested directory tree situation. the way get can just hit you with undef though π stay safe out there.
π METHODS π
π new( base_dir => $base_dir )
build yourself a brand new Catmandu::DirectoryIndex::UUID, no cap. it takes these configuration parameters:
base_dirβ seeCatmandu::DirectoryIndex. that's the whole list, she's low maintenance β¨
π LIMITATIONS π
the keys in this directory can only be UUID identifiers. periodt. don't try to sneak a random string in there, bestie, she will not be accepting that π
π INHERITED METHODS π
this Catmandu::DirectoryIndex::Number implements:
Catmandu::DirectoryIndex
(yes, that's literally what the page says. i'm just the messenger π§)
π¦ SEE ALSO π¦
Catmandu::DirectoryIndexβ go read this one too, it's the main character and this module is its little sister π
and that's the whole vibe check, bestie. this was Catmandu::DirectoryIndex::UUID(3pm) from perl v5.36.0, dated 2022-12-10 β slay, ate, no crumbs left πβ π
π¦ where this page comes from
- debian bookworm: libcatmandu-filestore-perl 1.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatmandu-filestore-perl 1.16-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms