NAME

constant::string::uc - Perl pragma to declare constants with the uppercased values as names

VERSION

version 2026.267

SYNOPSIS

use constant::string::uc qw( foo bar baz );

print FOO;  # Outputs: foo
print BAR;  # Outputs: Bar

DESCRIPTION

This pragma allows you to declare compile-time constants without having to explicitly repeat their names as string values. Passing a list of strings to use constant::string::uc creates UPPPERCASE constant subroutines in the caller's namespace where each constant returns the original value passed to constant::string::uc.

It behaves exactly like the core constant pragma under the hood, meaning these are fully optimized, inlined compile-time constants—not regular subroutine calls.

SEE ALSO

  • constant - The core Perl pragma utilized under the hood.

  • constant::string - Perl pragma to declare constants with the same names as their values, no uppercasing

AUTHOR

James Wright <jameswright6@acm.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by James Wright.

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