URI::P...L::Type(3pm)

πŸ“¦ version 2.25, in ubuntu resolute, ubuntu stonking

πŸ’– URI::PackageURL::Type πŸ’–

okay bestie, this is the manual page for URI::PackageURL::Type, part of the User Contributed Perl Documentation for URI::PackageURL::Type(3pm) β€” and yes, it's the PURL type definition class for URI::PackageURL. Let's get into it ✨


🌸 NAME 🌸

URI::PackageURL::Type β€” the PURL type definition class for URI::PackageURL. it's giving "class that knows things about types" and honestly? iconic πŸ’…


✨ SYNOPSIS ✨

use URI::PackageURL::Type;

# Load 'cpan' PURL type definition
$type = URI::PackageURL::Type->new('cpan');

say $type->definition->{description};

like, you load a type definition, then you peek at its description. simple. clean. slay 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

URL::PackageURL::Type is the PURL type definition helper for URL::PackageURL.

(yes, bestie, that's literally what it says β€” URL::PackageURL::Type and URL::PackageURL, no I, we are not editing the original text, that's the whole vibe of a manpage 😌)

πŸŽ€ FUNCTIONAL INTERFACE πŸŽ€

definition_dir

$path = URI::PackageURL::Type::definition_dir();

hand it back the local PURL type definitions directory. that's it, that's the function πŸ’–

🌈 OBJECT-ORIENTED INTERFACE 🌈

new

$purl_type = URI::PackageURL::Type->new($purl_type)

makes you a brand new URI::PackageURL::Type instance and loads up the PURL type definition so you can normalize and validate stuff. main character constructor energy ✨

$purl_type = URI::PackageURL::Type->new('cpan');

normalize

$purl_type->normalize(%components)

this one does the PURL components normalization, lowkey one of the best parts:

%components = $purl_type->normalize(
    type      => 'CPAN',
    namespace => 'gdt',
    name      => 'URI-PackageURL'
);

say Dumper(\%components);

# {
#   type      => 'cpan',
#   namespace => 'GDT',
#   name      => 'URI-PackageURL'
# }

look at that glow-up β€” CPAN became cpan, gdt became GDT πŸ”₯

validate

$purl_type->validate(%components)

does the PURL components validation. vibe check for your components, no cap:

$purl_type->validate(
    type => 'CPAN',
    name => 'URI-PackageURL'
);

Definition

$purl_type->schema_id
$purl_type->type_name
$purl_type->description
$purl_type->default_repository_url
$purl_type->examples
$purl_type->repository
$purl_type->note
$purl_type->reference_urls

all the definition accessors, lined up like a little squad 🫢

Component definition

$purl_type->namespace_definition
$purl_type->name_definition
$purl_type->version_definition
$purl_type->qualifiers_definition
$purl_type->subpath_definition

one per component, because each one deserves its own moment πŸ’…

Helpers

$purl_type->component_have_definition($component)
$purl_type->component_definition($component)
$purl_type->component_case_sensitive($component)
$purl_type->component_is_case_sensitive($component)
$purl_type->component_is_optional($component)
$purl_type->component_is_prohibited($component)
$purl_type->component_is_required($component)
$purl_type->component_native_name($component)
$purl_type->component_normalization_rules($component)
$purl_type->component_note($component)
$purl_type->component_permitted_characters($component)
$purl_type->component_requirement($component)

the helper squad, all taking $component. take notes bestie, there's twelve of them and we are not skipping any 🧚


πŸ’œ SUPPORT πŸ’œ

πŸ› Bugs / Feature Requests πŸ›

found a bug? want a feature? pls report them through the issue tracker at <https://github.com/giterlizzi/perl-URI-PackageURL/issues>. you'll get notified automatically of any progress on your issue, which is genuinely so nice of them 😭

πŸ“¦ Source Code πŸ“¦

this is open source software. the code repository is out there for public review and contribution under the terms of the license.

<https://github.com/giterlizzi/perl-URI-PackageURL>

git clone https://github.com/giterlizzi/perl-URI-PackageURL.git

clone it, bestie, go be part of the story ✨


πŸ‘‘ AUTHOR πŸ‘‘

  • Giuseppe Di Terlizzi <gdt@cpan.org>

This software is copyright (c) 2022-2026 by Giuseppe Di Terlizzi.

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


and that's the whole page, bestie πŸ’– this was documented with perl v5.40.1 and dated 2026-01-31, so go forth and normalize your PURL types with main character confidence πŸŽ€πŸ¦‹ periodt ✨

πŸ“¦ where this page comes from