DhMake...::Utils(3pm)

πŸ’– NAME πŸ’–

okay so bestie, this is DhMakePerl::Utils β€” the 3pm manual page β€” and it's literally just a lil' grab-bag of helper routines for dh-make-perl and alike. that's the whole vibe. utility central. πŸ› οΈβœ¨


πŸŽ€ SYNOPSIS πŸŽ€

here's the lil' taste test of how you actually call this stuff:

use DhMakePerl::Utils qw(is_core_module);

my $v = is_core_module('Test::More', '1.002');
my $v = nice_perl_ver('5.010001');

πŸ¦‹ FUNCTIONS πŸ¦‹

real talk first: none of the following functions is exported by default. so if you want one, you gotta ask for it. no free rides, no auto-imports, we're doing consent-based exports in this house. πŸ’…

🌸 apt_cache

evaluates the creation of an AptPkg::Cache, and hands it back to you on success. it's giving "let me just check if that actually worked first." βœ…

🌸 find_cpan_module

returns a CPAN::Module object that corresponds to the argument you supplied. if CPAN can't find any module for it, you get undef back. πŸ«₯

heads up though: if the CPAN module needs to be configured in some way, that has to happen before you call this function. it's not gonna set itself up for you, bestie.

🌸 find_cpan_distribution

same deal as above but for a CPAN::Distribution object β€” it corresponds to the argument you supplied, and if CPAN doesn't find any distribution, you get undef. nah, nothing. 😭

and yeah, same rule: if the CPAN module needs configuring in some way, do that before calling this function.

🌸 is_core_perl_package package

returns a true value if the package you gave it is a core Perl package β€” like, one of "perl", "perl-base", "perl-modules-X.Y", "libperlX.Y", and "perl-xs-dev". πŸ‘‘

having this live in one central routine makes it way easier to add or remove packages from that list. one spot, one edit, iconic behavior honestly.

🌸 is_core_module module, version

returns the version of the "perl" package that contains the given module (at least version version).

but if the module is not a core module β€” or not a core module anymore πŸ₯² β€” in the current "perl" release, you get undef.

🌸 nice_perl_ver version_string

re-formats a perl version so it matches Debian's perl package versions. ✨

so like, 5.010 (and also 5.01) gets converted into 5.10. glow-up accomplished.

🌸 core_module_perls module[, min-version]

returns a list of Perl versions that have module.

and if you pass min-version too? then the list only contains the Perl versions that have module at at least min-version. filter engaged. πŸ”

🌸 find_core_perl_dependency( $module[, $version] )

returns a dependency on perl containing the required module version.

but if the module isn't available in any perl released by Debian, or if it's not in the current perl anymore, then you get undef. sorry babe, it's just not there. πŸ’€

🌸 split_version_relation string

splits the string β€” usually something you'd find in the values of dependency fields in CPAN META β€” into a relation and a version.

if no relation is found in the string, ">=" is assumed. defaults, we love them. 🫢

returns a list of relation and version, and that relation is suitable for using in Debian package dependency version requirements.

for example:

split_version_relation('0.45') returns ( '>=', '0.45' )
split_version_relation('< 0.56') returns ( '<<', '0.56' )

see how 0.45 had no relation, so it just got >= handed to it? and how < became <<? yeah. that's the whole trick. ⭐


Copyright (C) 2008, 2009, 2010 Damyan Ivanov <dmn@debian.org>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


okay that's the whole page, bestie, you're fully caught up. πŸ’– this was perl v5.40.1, dated 2026-05-08, and it ate. periodt. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from