CLI::Si...nstants(3)
π 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:$DOTand$PERIODare 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 ontoLog::Log4perlconstants:
%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
- fedora 43: perl-CLI-Simple 2.2.5-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms