CLI::Si...nstants(3)

πŸ“¦
version 2.2.5 Β· 3 versions
, in fedora 43

πŸ’– CLI::Simple::Constants πŸ’–

okay bestie, welcome to CLI::Simple::Constants β€” it's a Perl module (we're in section 3 of the manual, the "User Contributed Perl Documentation" corner of the world) that hands you a whole lil' grab bag of exportable constants for CLI::Simple-based applications. iykyk. πŸŽ€


✨ NAME ✨

CLI::Simple::Constants β€” exportable constants for CLI::Simple-based applications. that's it, that's the whole name, she's straightforward and we respect her for it πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

use CLI::Simple::Constants qw(:booleans :chars :log-levels);

return $SUCCESS if $flag;
print $PADDING, "=>", $SPACE, $EQUALS_SIGN, "\n" if $DEBUG;

see how ibeautifully that reads?? pull in the tags, use the constants, done. no cap. ✨


🌸 DESCRIPTION 🌸

bestie, this module is your little stash of constants that you constantly end up needing when you're building command-line tools β€” especially the ones built on top of CLI::Simple. it just hands them to you, pre-made, so you're not out here typing magic numbers and stray characters like a gremlin. πŸ™ˆ

here's the vibe of what's inside:

  • Boolean values, for control flow or that good good shell-style success/failure energy
  • Character constants, for formatting and CLI-friendly output
  • Predefined log level names, for using with Log::Log4perl
  • Export tags, so you can grab constants grouped by their whole intent πŸ‘‘

πŸ‘‘ EXPORT TAGS πŸ‘‘

  • :booleans β€” semantic truthy values plus the shell-style success/failure crew:
$TRUE    => 1
$FALSE   => 0
$SUCCESS => 0   # shell success
$FAILURE => 1   # shell failure
  • :chars β€” exports the single-character string constants you keep reaching for:
$AMPERSAND          => '&'
$COLON              => ':'
$COMMA              => ','
$DOUBLE_COLON       => '::'
$DASH               => '-'
$DOT                => '.'
$EMPTY              => ''
$EQUALS_SIGN        => '='
$OCTOTHORP          => '#'
$PERIOD             => '.'
$QUESTION_MARK      => '?'
$SLASH              => '/'
$SPACE              => ' '
$TEMPLATE_DELIMITER => '@'
$UNDERSCORE         => '_'
quick note bestie: $DOT and $PERIOD are synonyms, and they exist purely so the name makes semantic sense for whatever you're doing. cute, right? πŸ’–
  • :strings β€” string constants that exist for formatting purposes:
$PADDING => '    '   # 4 spaces, commonly used for indentation
  • :log-levels β€” gives you a hash that maps symbolic log level names onto Log::Log4perl constants:
%LOG_LEVELS => (
  debug => $DEBUG,
  trace => $TRACE,
  info  => $INFO,
  warn  => $WARN,
  error => $ERROR,
  fatal => $FATAL,
)
  • :all β€” literally exports every constant from all the tags above. the whole squad. the entire slay. πŸ”₯

🫢 SEE ALSO 🫢

Log::Log4perl, CLI::Simple


🧚 AUTHOR 🧚

Rob Lauer β€” <rlauer@treasurersbriefcase.com>


πŸ’œ LICENSE πŸ’œ

Same terms as Perl itself. periodt.


okay that's the whole page, you ate it, you're iconic 🌈 this was CLI::Simple::Constants, page 3, from perl v5.42.3, dated 2026-10-06 β€” mwah, go forth and use your constants responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from