Test2::...:Module(3pm)

🌸 NAME 🌸

okay so this is the Test2::...:Module(3pm) page from the Perl Programmers Reference Guide, and the main character is Test2::Require::Module πŸ’– β€” the module that skips tests if certain packages are not installed, or if their versions are insufficient. slay.

πŸŽ€ DESCRIPTION πŸŽ€

Sometimes you have tests that are nice to run, but they depend on tools that may not be available 😭. Instead of adding the tool as a dep, or making the test always skip, it’s common to make the test run conditionally. This package helps make that possible. iconic.

This module is modeled after Test::Requires. The difference is that this module is based on Test2 directly, and does not go through Test::Builder. Another difference is that the packages you check for are not imported into your namespace for you. This is intentional. no cap β€” that last bit is on purpose, bestie πŸ’….

✨ SYNOPSIS ✨

Here’s the exact code vibe check πŸ‘‡ keep it verbatim:

    # The test will be skipped unless Some::Module is installed, any version.
    use Test2::Require::Module 'Some::Module';

    # The test will be skipped unless 'Other::Module' is installed and at
    # version '5.555' or greater.
    use Test2::Require::Module 'Other::Module' => '5.555';

    # We now need to use them directly, Test2::Require::Module does not import
    # them for us.
    use Some::Module;
    use Other::Module;

That’s it β€” Test2::Require::Module does not import the checked packages for you, so you use them directly after. 🫢

🌈 SOURCE 🌈

The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/. <orange>go off, bestie</orange> πŸ”₯.

πŸ‘‘ MAINTAINERS πŸ‘‘

  • Maintainer: Chad Granum <exodist@cpan.org>

πŸ¦‹ AUTHORS πŸ¦‹

  • Author: Chad Granum <exodist@cpan.org>

Copyright Chad Granum <exodist@cpan.org>.

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

See http://dev.perl.org/licenses/


mwah πŸ’‹ that’s the whole page, bestie β€” served from perl v5.42.3, dated 2026-11-03, and filed under the Test2::...:Module(3pm) manual page. bye 🫢

πŸ“¦ where this page comes from