XXX(3pm)
π XXX π
okay bestie, sit down, hydrate, and let me tell you about the module that lets you See Your Data in the Nude. yes that's literally the NAME. it's iconic, it's chaotic, it's giving main character energy. π
β¨ VERSION β¨
this doc is describing XXX version 0.38. she's grown, she's evolved, she's serving. π
πΈ SYNOPSIS πΈ
look at this flexibility. the way she fits anywhere in your code:
use XXX;
XXX my $dog = Dog->new({has => ['fleas', 'style']});
my $dog = XXX Dog->new({has => ['fleas', 'style']});
my $dog = Dog->new(XXX {has => ['fleas', 'style']});
my $dog = Dog->new({XXX has => ['fleas', 'style']});
my $dog = Dog->new({has => XXX ['fleas', 'style']});
my $dog = Dog->new({has => [XXX 'fleas', 'style']});
like. she can go ANYWHERE. insert her mid-expression, mid-hash, mid-array, wherever. no cap. π¦
π DESCRIPTION π
XXX.pm exports a function called XXX that you can drop basically anywhere in your Perl code, and it will die with a YAML dump of whatever arguments are sitting to its right. dramatic exit, but make it data.
the charm of XXX-debugging (and yes, it IS charming, it's the moment) is that:
- it is easy to type β three letters, that's it
- it rarely requires parens β so it slides right in
- it stands out visually β so you actually REMEMBER to remove it before you ship π
XXX.pm also exports WWW, YYY and ZZZ, which do similar debugging things. she's got a whole friend group. π
π₯ FUNCTIONS π₯
WWW
WWW will warn a dump of its arguments, and then return the original arguments. that means you can stick it in the middle of expressions and nothing breaks, it just yells a little. π
NOTE: If you useWWWwith Test::More, it willdiag()rather thanwarn().
mnemonic: W for warn
XXX
XXX will die with a dump of its arguments.
mnemonic: XXX == Death, Nudity β yes, really. that's the mnemonic. she said what she said. π
YYY
YYY will print a dump of its arguments, and then return the original arguments. same energy as WWW but louder and printed, so again β mid-expression placement is fully allowed.
NOTE: If you useYYYwith Test::More, it willnote()rather thanprint().
mnemonic: YYY == Why Why Why??? or YAML YAML YAML
ZZZ
ZZZ will Carp::confess a dump of its arguments. full confession. no secrets. π
mnemonic: You should confess all your sins before you sleep. zzzzzzzz
DDD
DDD will start an interactive debugger session using the Enbugger module. by default it will use the Perl debugger, but you can switch to the fancier Devel::Trepan debugger by setting the environment variable PERL_XXX_DEBUGGER=trepan. β¨
in the debugger session you will be able to both read and modify all variables, including lexical variables. everything. all of it. the whole vibe. π«Ά
mnemonic: Debug, Debug, Debug!
π USE XXX WITHOUT use XXX; π
if you export PERL5OPT='-MXXX=global' in your shell environment, then XXX will always be loaded, and all the functions will also be exported into the main namespace. that means you can call XXX from any package with ::XXX (since :: is a synonym for main::). no imports, no setup, just vibes. π
also XXX will be exported as $::XXX which you can use like this:
$self->foo->$::WWW->bar;
this will warn a YAML dump of $self, returning $self so that bar will be called correctly. method chaining but make it nosy. π
π§ CONFIGURATION π§
by default, XXX uses YAML::PP to dump your data. you can change this like so:
use XXX -with => 'Data::Dumper';
use XXX -with => 'Data::Dump';
use XXX -with => 'Data::Dump::Color';
use XXX -with => 'YAML';
use XXX -with => 'YAML::XS';
use XXX -with => 'YAML::SomeOtherYamlModule';
use XXX -with => 'JSON::Color';
use XXX -with => 'JSON::SomeOtherJsonModule';
you can also use the environment variable PERL_XXX_DUMPER to set the module, for example:
PERL_XXX_DUMPER=JSON::Color perl script.pl
PERL_XXX_DUMPER=YAML::PP::Highlight perl script.pl
only modules with names beginning with'YAML'or'JSON', and theData::Dumper,Data::Dump, andData::Dump::Colormodules are supported. don't try to sneak anything else in there bestie, she will not allow it. π
if you need to load XXX with require, you can set the dumper module with the $XXX::DumpModule global variable:
require XXX;
$XXX::DumpModule = 'YAML::Syck';
XXX::XXX($variable);
β STACK TRACE LEVEL β
if you call a debugging function that calls XXX for you, XXX will print the wrong file and line number. tragic. the call stack is lying to you. π
to force XXX to skip a package in the call stack, just define the XXX_skip constant like this:
package MyDebugger;
use constant XXX_skip => 1;
sub debug {
require XXX;
XXX::XXX(@_);
}
now calls to MyDebugger::debug will print the file name you called it from, not from MyDebugger itself. accuracy restored, slay. β¨
π AUTHOR π
Ingy dΓΆt Net <ingy@cpan.org>
π COPYRIGHT AND LICENSE π
Copyright 2006-2021. Ingy dΓΆt Net.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
and that's the whole page bestie, no notes, we ate. this was perl v5.32.1, dated 2021-09-12, and you just read XXX(3pm) β go forth and debug in the nude. π
π¦π
π¦ where this page comes from
- debian bookworm: libxxx-perl 0.38-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxxx-perl 0.38-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libxxx-perl 0.38-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxxx-perl 0.38-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxxx-perl 0.38-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxxx-perl 0.38-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