Dist::Zilla::Plugin::Prereqs::MatchInstalled - Depend on versions of modules the same as you have installed


version 1.001003


This is based on the code of [Author::KENTNL::Prereqs::Latest::Selective], but intended for a wider audience.

    module = My::Module

If you want to automatically add all modules that are prereqs, perhaps instead look at [Prereqs::MatchInstalled::All]

NOTE: Dependencies will only be upgraded to match the Installed version if they're found elsewhere in the dependency tree.

This is designed so that it integrates with other automated version provisioning.

If you're hard-coding module dependencies instead, you will want to place this module after other modules that declare dependencies.

For instance:

    Foo = 0

    module = Foo

^^ Foo will be upgraded to the version installed.

By default, dependencies that match values of module will be upgraded when they are found in:

    phase: build, test, runtime, configure, develop
    relation: depends, suggests, recommends

To change this behavior, specify one or more of the following parameters:

    applyto_phase = build
    applyto_phase = configure

    applyto_relation = requires


For more complex demands, this also works:

    applyto = build.requires
    applyto = configure.recommends

And that should hopefully be sufficient to cover any conceivable use-case.

Also note, we don't do any sort of sanity checking on the module list you provide.

For instance,

    module = strict
    module = warning

Will both upgrade the strict and warnings dependencies on your module, regardless of how daft an idea that may be.

And with a little glue

    module = perl

Does what you want, but you probably shouldn't rely on that :).



The following properties can be specified multiple times:

  • applyto

  • applyto_relation

  • applyto_phase

  • modules


The module is an alias for modules



Attempts to find the current version of $package.

Returns undef if something went wrong.


This is for Dist::Zilla::Role::PrereqSource, which gets new prerequisites from this module.



Determines which phases will be checked for module dependencies to upgrade.

    applyto_phase = build
    applyto_phase = test

Defaults to:

    build test runtime configure develop


Determines which relations will be checked for module dependencies to upgrade.

    applyto_relation = requires

Defaults to:

    requires suggests recommends


Determines the total list of phase/relation combinations which will be checked for dependencies to upgrade.

If not specified, is built from applyto_phase and applyto_relation

    applyto = runtime.requires
    applyto = configure.requires


Contains the list of modules that will be searched for in the existing Prereqs stash to upgrade.

    module = Foo
    module = Bar
    modules = Baz ; this is the same as the previous 2

If you want to automatically add all modules that are prereqs, perhaps instead look at [Prereqs::MatchInstalled::All]




Contains the contents of applyto represented as an ArrayRef[ArrayRef[Str]]


Contains a copy of modules as a hash for easy look-up.







Kent Fredric <>


This software is copyright (c) 2017 by Kent Fredric <>.

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