CLI::Simple::Utils(3)

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

πŸŽ€ NAME πŸŽ€

CLI::Simple::Utils β€” genuinely handy utility functions for CLI::Simple-based applications ✨


πŸ’… SYNOPSIS πŸ’…

CLI::Simple::Utils qw(choose);

That's it bestie, that's the whole vibe. πŸ¦‹


🌸 DESCRIPTION 🌸

Utilities that might actually be useful when you're writing command line scripts. Little grab-bag of helpers, no cap. πŸ’–


πŸ‘‘ METHODS AND SUBROUTINES πŸ‘‘

πŸ“ choose

An anonymous subroutine out here disguising itself as a block level internal subroutine (of sorts). Use this when a ternary or a cascading if/else block just... feels wrong, and honestly? It does. 😭

choose {
  return "foo"
    if $bar;

  return "bar"
    if $foo;
};

πŸ¦‹ dmp

dmp this => $this, that => $that;

Such a shortcut for this, fr fr:

print {*STDERR} Dumper([this => $this, that => $that]);

✨ file_or_stdout

file_or_stdout([file], [mode]);

Returns an open file handle by opening a passed file and optional mode β€” OR returns \*STDOUT if file is empty or '-'. Like, it just picks for you. Iconic. πŸ’…

πŸ’œ slurp_json

slurp_json($file)

Returns a Perl object from a presumably JSON encoded file. Presumably, bestie. πŸ™ˆ

🌈 slurp

slurp(file)

Returns the entire contents of a file. And file can be either the path to a file or an open file handle β€” flexible queen. 🫢


⭐ VERSION ⭐

This documentation refers to version 2.2.5 πŸ’–


This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <https://dev.perl.org/licenses/> for more information. πŸŽ€


🌸 AUTHOR 🌸

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


🧚 SEE ALSO 🧚

  • CLI::Simple

okay that's the whole page bestie, you ate it πŸ’… β€” this was CLI::Simple::Utils(3), documented for perl v5.42.3 and dated 2026-10-06. Go write something cute in your terminal, mwah 🫢🌟

πŸ“¦ where this page comes from