The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Dist::Zilla::Plugin::PERLANCAR::Authority - Add the $AUTHORITY variable and metadata to your distribution


This document describes version 0.001 of Dist::Zilla::Plugin::PERLANCAR::Authority (from Perl distribution Dist-Zilla-Plugin-PERLANCAR-Authority), released on 2020-08-10.


Fork note: This plugin is a fork of Dist::Zilla::Plugin::Authority. When PAUSE credential is not found, this plugin will set $AUTHORITY to cpan:<none> instead of bailing out. TODO: bail if PAUSE credentials is not found and we are doing a release (instead of just 'dzil test' or 'dzil build'). The rest is Dist::Zilla::Plugin::Authority's documentation.

This plugin adds the authority data to your distribution. It adds the data to your modules and metadata. Normally it looks for the PAUSE author id in your Dist::Zilla configuration. If you want to override it, please use the 'authority' attribute.

        # In your dist.ini:

This code will be added to any package declarations in your perl files:

        our $AUTHORITY = 'cpan:APOCAL';

Your metadata ( META.yml or META.json ) will have an entry looking like this:

        x_authority => 'cpan:APOCAL'



The authority you want to use. It should be something like cpan:APOCAL.

Defaults to the username set in the %PAUSE stash in the global config.ini or dist.ini ( Dist::Zilla v4 addition! )

If you prefer to not put it in config/dist.ini you can put it in "~/.pause" just like Dist::Zilla did before v4.


A boolean value to control if the authority should be added to the metadata.

Defaults to true.


A boolean value to control if the $AUTHORITY variable should be added to the modules.

Defaults to true.


A boolean value to control if the $AUTHORITY variable should be added where a # AUTHORITY comment is found. If this is set then an appropriate comment is found, and our $AUTHORITY = 'cpan:PAUSEID'; is inserted preceding the comment on the same line.

This basically implements what OurPkgVersion does for PkgVersion.

Defaults to false.

NOTE: If you use this method, then we will not use the pkg style of declaration! That way, we keep the line numbering consistent.


A value to control the type of the $AUTHORITY declaration. There are two styles: 'pkg' or 'our'. In the past this module defaulted to the 'pkg' style but due to various issues 'our' is now the default. Here's what both styles would look like in the resulting code:

        # pkg
        BEGIN {
                $Dist::Zilla::Plugin::Authority::AUTHORITY = 'cpan:APOCAL';

        # our
        our $AUTHORITY = 'cpan:APOCAL';


Please visit the project's homepage at


Source repository is at


Please report any bugs or feature requests on the bugtracker website

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.




perlancar <>


This software is copyright (c) 2020 by

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