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

πŸ“¦
version 2.25 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, buckle up, because this page is a little ✨self-building✨ icon. The name it reports is literally:

$type - $type_name

yep, those are template variables staring right back at you β€” the generator fills them in per package type. not me explaining a placeholder like it's deep πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

$description

that's the whole vibe. it's a placeholder too, swapped out for the real description of whatever package type you're looking at. short, sweet, mysterious, main character energy fr fr πŸŽ€


🌸 SYNTAX 🌸

The structure of a PURL for this package type is, no cap:

$purl_syntax

and then β€” and this is the part where it gets good β€” the page hands you the actual template code that builds it. yes, the manpage contains its own generator. it's giving inception. πŸ™ˆ

MAN

    foreach my $component (qw[namespace name version subpath]) {

        next unless $definition->component_have_definition($component);

        my $requirement          = $definition->component_requirement($component);
        my $permitted_characters = $definition->component_permitted_characters($component);
        my $normalization_rules  = $definition->component_normalization_rules($component);
        my $case_sensitive       = $definition->component_case_sensitive($component);
        my $native_name          = $definition->component_native_name($component);
        my $note                 = $definition->component_note($component);

        $man .= sprintf "=head2 %s\n\n", ucfirst $component;
        $man .= "=over 2\n\n";

        if ($requirement) {
            $man .= sprintf "=item B<Requirement>: %s\n\n", ucfirst($requirement);
        }

        if ($permitted_characters) {
            $man .= sprintf "=item B<Permitted Characters>: %s\n\n", ucfirst($permitted_characters);
        }

        if ($case_sensitive) {
            $man .= sprintf "=item B<Is Case Sensitive>: %s\n\n", ($case_sensitive ? 'Yes' : 'No');
        }

        if (@{$normalization_rules}) {

            $man .= "=item B<Normalization Rules>:\n\n";
            $man .= "=over 2\n\n";

            foreach (@{$normalization_rules}) {
                $man .= sprintf "=item * %s\n\n", $_;
            }

            $man .= "=back\n\n";

        }

        if ($native_name) {
            $man .= "=item B<Native Label>: $native_name\n\n";
        }

        $man .= "=back\n\n";

        if ($note) {
            $man .= sprintf "%s\n\n", _md_to_pod($note);
        }
    }

    if (@{$qualifiers_definition}) {

        $man .= "=head2 Qualifiers\n\n";
        $man .= "=over 2\n\n";

        foreach my $qualifier (@{$qualifiers_definition}) {

            $man .= sprintf "=item C<%s>\n\n", $qualifier->{key};

            if (my $requirement = $qualifier->{requirement}) {
                $man .= sprintf "Requirement: %s\n\n", ucfirst($requirement);
            }

            if (my $native_name = $qualifier->{native_name}) {
                $man .= sprintf "Native name: %s\n\n", $native_name;
            }

            if (my $default_value = $qualifier->{default_value}) {
                $man .= sprintf "Default value: %s\n\n", $default_value;
            }

            $man .= sprintf "%s\n\n", _md_to_pod($qualifier->{description});

        }

        $man .= "=back\n\n";

    }

    if ($repository) {

        my $use_repository         = $repository->{use_repository} ? 'Yes' : 'No';
        my $default_repository_url = $repository->{default_repository_url};

        $man .= "=head1 REPOSITORY\n\n";
        $man .= "=over\n\n";
        $man .= sprintf "=item B<Use repository>: %s\n\n",         $repository->{use_repository} ? 'Yes' : 'No';
        $man .= sprintf "=item B<Default repository URL>: %s\n\n", $repository->{default_repository_url} || '(none)';
        $man .= "=back\n\n";

        if (my $note = $repository->{note}) {
            $man .= sprintf "%s\n\n", _md_to_pod($note);
        }

    }

    if (@{$examples}) {

        $man .= "=head1 EXAMPLES\n\n";
        $man .= "=over 2\n\n";

        foreach (@{$examples}) {
            $man .= sprintf "=item * %s\n\n", $_;
        }

        $man .= "=back\n\n";

    }

    if ($note) {
        $man .= "=head1 NOTES\n\n";
        $man .= sprintf "$note\n\n";
    }

    $man .= "=head1 REFERENCES\n\n";
    $man .= "=over 2\n\n";

    $man .= sprintf "=item * %s schema ID, L<%s>\n\n", $type_name, $schema_id;

    foreach (@{$reference_urls}) {
        $man .= sprintf "=item * %s reference, L<%s>\n\n", $type_name, $_;
    }

    $man .= "=item * PURL specification, L<https://github.com/package-url/purl-spec>\n\n";
    $man .= "=item * VERS specification, L<https://github.com/package-url/vers-spec>\n\n";

    $man .= "=back\n\n";

    Pod::Text->new->parse_string_document($man, \my $output);

    exit;

}

1;

__END__

like... it generates its own manpage and then exits. iconic behaviour, honestly. πŸ‘‘


πŸ’œ NAME πŸ’œ

(and yes bestie, there's a second NAME section β€” the page is built from a template so it happens twice. we keep it. no notes.)

URI::PackageURL::App β€” URI::PackageURL (PURL) Command Line Interface


πŸŽ€ SYNOPSIS πŸŽ€

use URI::PackageURL::App qw(run);

run(\@ARGV);

🌈 DESCRIPTION 🌈

URI::PackageURL::App is the "Command Line Interface" helper module for purl-tool(1). it's the little backstage gremlin that makes the CLI go. 🧚

  • URI::PackageURL->run(@args) β€” Execute the command
  • cli_error($error) β€” Clean error

✨ AUTHOR ✨

Giuseppe Di Terlizzi <https://metacpan.org/author/gdt>


Copyright Β© 2022-2026 Giuseppe Di Terlizzi <https://metacpan.org/author/gdt>

You may use and distribute this module according to the same terms that Perl is distributed under.


and that's the whole page, bestie β€” URI::P...L::App(3pm), part of the User Contributed Perl Documentation, last updated 2026-01-31 and shipped with perl v5.40.1. go forth and parse your PURLs πŸ’…βœ¨

πŸ“¦ where this page comes from