logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

PerlX::Define - cute syntax for defining constants

Author

       Toby Inkster <tobyink@cpan.org>.

Bugs

       Please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=PerlX-Define>.

Description

       PerlX::Define is a yet another module for defining constants.

       Differences from constant.pm:

       •   Cute syntax.

           Like constant.pm, constants get defined at compile time, not run time.

       •   Requires Perl 5.12 or above.

           If  you're  lucky  enough  to  be  able  to  free yourself from the shackles of supporting decade-old
           versions of Perl, PerlX::Define is your friend.

       •   Only supports scalar constants.

           List constants are rarely useful.

           Your constant can of course be a reference to an array or hash, but this module  doesn't  attempt  to
           make the referred-to structure read only.

       •   Doesn't  try  to  handle  some  of  the things constant.pm does like declaring constants using fully-
           qualified names, or defining constants pointing at magic scalars.

       Prior to version 0.100, PerlX::Define was bundled with Moops.

Disclaimer Of Warranties

       THIS  PACKAGE  IS  PROVIDED  "AS  IS"  AND  WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
       LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

perl v5.36.0                                       2022-12-06                                 PerlX::Define(3pm)

Name

       PerlX::Define - cute syntax for defining constants

See Also

       constant.

       Moops.

Synopsis

          use v5.12;
          use strict;
          use warnings;

          package MyMaths {
             use PerlX::Define;
             define PI = 3.2;
          }

See Also