Dist::...d::Util(3pm)

πŸ’– NAME πŸ’–

okay so bestie, welcome to Dist::Build::Util β€” it's literally just a lil grab-bag of utility functions for Dist::Build. That's the whole vibe. You'll find this page filed under Dist::...d::Util(3pm) in the User Contributed Perl Documentation, and honestly? She's a small page but she ate. ✨


🌸 VERSION 🌸

version 0.028 πŸŽ€


✨ SYNOPSIS ✨

the whole thing, in all her glory:

use Dist::Build::Util 'module_dir';
say module_dir('Dist::Build');

like. that's it. that's the entrance exam. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So this module is a collection of utility functions for Dist::Build, periodt. Currently it's got the sharedir functions and nothing else, but the door is open β€” more functions may be added in the future, so don't get too comfy with the current roster. πŸ™ˆ


πŸ’œ FUNCTIONS πŸ’œ

πŸ“ dist_dir

# Get a distribution's shared files directory
my $dir = dist_dir('My-Distribution');

The dist_dir function takes one single parameter: the name of an installed distribution (CPAN or otherwise, we don't gatekeep 🌈). Then it goes and locates the shared data directory that got created at install time for that distribution.

She returns the directory path as a string. 🫢

BUT β€” if it can't be located, or it's not readable, she dies. No cap, no soft launch, just death. πŸ’€

This is part of the :sharedir export group, iykyk. πŸ‘‘

🧚 module_dir

# Get a module's shared files directory
my $dir = module_dir('My::Module');

The module_dir function also takes one single parameter: the name of an installed module (again, CPAN or otherwise). Same energy as her sister function β€” she locates the shared data directory created at install time for it.

Returns the directory path as a string. πŸ’–

And again: can't locate it, or it's not readable? She dies. 😭

This one is also part of the :sharedir export group. Matching besties fr fr. 🌸


πŸ‘‘ AUTHOR πŸ‘‘

Leon Timmermans <fawaka@gmail.com> β€” the icon, the moment, the main character who wrote this. πŸ’…


This software is copyright (c) 2024 by Leon Timmermans.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. 🫢


okay that's the whole page bestie, go forth and locate your sharedir ✨

this was Dist::...d::Util(3pm) from perl v5.42.2, dated 2026-03-22 β€” tysm for reading, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from