Perinc...ugging(3pm)

πŸ’– NAME πŸ’–

Perinci::CmdLine::Manual::HowTo::Debugging β€” bestie, this is the how-to guide collection all about debugging πŸ›βœ¨ It's a manual page from the Perinci::CmdLine docs, and today we're learning how to figure out why ur CLI is acting up.

🌸 VERSION 🌸

okay so this doc describes version 2.000.2 of Perinci::CmdLine::Manual::HowTo::Debugging (she comes from the Perl distribution Perinci-CmdLine``**, iconic), and she was released on **2026-03-30` πŸŽ€


✨ DESCRIPTION ✨

So like… if ur hitting issues with Perinci::CmdLine 😭 don't panic bestie, here are the things u can try to help with debugging 🫢

πŸ”₯ Increase log level πŸ”₯

Perinci::CmdLine uses Log::ger. If ur command-line object was instantiated with the "log" attribute set to true, then u literally just need to pass --verbose, --debug, or --trace as command-line options and boom πŸ’₯ more logging statements appear:

% your-cli --verbose ...
% your-cli --debug ...
% your-cli --trace ...
% your-cli --log-level trace ... ;# ditto

But if ur command-line object was not instantiated with "log" set to true, no worries, u can still enable logging like this:

% PERL5OPT=-MLog::ger::Screen LOG_LEVEL=info your-cli ...
% PERL5OPT=-MLog::ger::Screen DEBUG=1 your-cli ...
% PERL5OPT=-MLog::ger::Screen TRACE=1 your-cli ...

πŸ¦‹ Dump parsed arguments, internal data structures πŸ¦‹

If staring at log statements is giving nothing πŸ‘€ and u still have no clue, u can try dumping various data structures. This is done with plugins πŸ’… For example, if u wanna dump the parsed command-line arguments after validation and then exit, use this command β€” and ngl, setting the log level to trace is highkey helpful so u can see the program flow and exactly at what points the plugins get triggered:

% PERINCI_CMDLINE_PLUGINS=-DumpArgs,-Exit@after_validate_args your-cli --trace ...

🌈 Logging other components 🌈

Also check out Log::ger::For::LWP, Log::ger::For::HTTP::Tiny, Log::ger::For::DBI, and Log::ger::DBI::Query ✨


πŸŽ€ HOMEPAGE πŸŽ€

Please visit the project's homepage at <https://metacpan.org/release/Perinci-CmdLine>. 🫢

πŸ‘‘ SOURCE πŸ‘‘

Source repository lives at <https://github.com/perlancar/perl-Perinci-CmdLine>. 🌸

⭐ SEE ALSO ⭐

  • Log::ger

πŸ’œ AUTHOR πŸ’œ

perlancar <perlancar@cpan.org> β€” the icon, the moment, the legend 🫑

🧚 CONTRIBUTING 🧚

Wanna help out?? Say less 😀 U can send patches by email / via RT, or send pull requests on GitHub.

Most of the time tho, u do not need to build the distribution urself. U can literally just modify the code, then test it via:

% prove -l

But if u do wanna build the distribution (like, say, to try installing it locally on ur system), u can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any extra steps required beyond that are considered a bug and should be reported to me πŸ‘€

This software is copyright (c) 2026 by perlancar <perlancar@cpan.org>.

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

πŸ’€ BUGS πŸ’€

Please report any bugs or feature requests on the bugtracker website <https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-CmdLine>. πŸ›

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. fr fr, it helps so much πŸ™

and that's the whole page bestie!! 🌈 this was Perinc...ugging(3pm) β€” perl v5.40.1, dated 2026-04-05, user contributed perl documentation. mwah, go forth and debug πŸ’…πŸ’–πŸŽ€

πŸ“¦ where this page comes from