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 π
π COPYRIGHT AND LICENSE π
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
- ubuntu stonking: libperinci-cmdline-perl 2.000.2-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms