Dist::...nstants(3pm)

🌸 NAME 🌸

Dist::Build::XS::WriteConstants β€” Dist::Build extension integrating ExtUtils::Constant. This is the page for Dist::...nstants(3pm) under User Contributed Perl Documentation, bestie, and it’s giving very β€œsmall module, big constant energy.” πŸ’…

✨ VERSION ✨

version 0.028 β€” that’s the version, periodt. πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

        load_extension('Dist::Build::XS');
        load_extension('Dist::Build::XS::WriteConstants');

        add_xs(
            module          => 'Foo::Bar',
            write_constants => {
                NAMES => [ qw/FOO BAR BAZ/ ],
            },
        );

🌈 DESCRIPTION 🌈

Okay so this module is an extension of Dist::Build::XS, and what it adds is one extra argument to the add_xs function: write_constants. That hash takes the same members as the WriteConstants function of ExtUtils::Constant, except it sets sensible default values for the NAME member (based on the module’s name), the C_FILE and XS_FILE members (based on the XS file’s directory and CONST_BASENAME defaulting to 'const') β€” so usually those will not need to be passed. Lowkey convenient, highkey iconic. 🫢

So the example up in the synopsis is equivalent to:

         {
           NAME    => 'Foo::Bar',
           NAMES   => [ qw/FOO BAR BAZ/ ],
           C_FILE  => 'lib/Foo/const-c.inc',
           XS_FILE => 'lib/Foo/const-xs.inc',
         }

πŸ’Œ AUTHOR πŸ’Œ

Leon Timmermans <fawaka@gmail.com> β€” yes, that’s the author, bestie. πŸ’–

This software is copyright (c) 2024 by Leon Timmermans. πŸŽ€

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Slay, legal text, slay. πŸ’…


Footer vibes: this is the Dist::...nstants(3pm) page, with perl v5.40.1 and date 2026-03-21. That’s the source/version and date, bestie β€” bye! 🫢✨

πŸ“¦ where this page comes from