XXX - See Your Data in the Nude
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']});
XXX.pm exports a function called XXX that you can put just about anywhere in your Perl code to make it die with a YAML dump of the arguments to its right.
The charm of XXX-debugging is that it is easy to type, rarely requires parens and stands out visually so that you remember to remove it.
XXX.pm also exports WWW, YYY and ZZZ which do similar debugging things.
WWW will warn a dump of its arguments, and then return the original arguments. This means you can stick it in the middle of expressions.
NOTE: If you use WWW with Test::More, it will <diag()> rather than warn().
warn()
mnemonic: W for warn
XXX will die with a dump of its arguments.
mnemonic: XXX == Death, Nudity
YYY will print a dump of its arguments, and then return the original arguments. This means you can stick it in the middle of expressions.
NOTE: If you use YYY with Test::More, it will <note()> rather than print().
print()
mnemonic: YYY == Why Why Why??? or YAML YAML YAML
ZZZ will Carp::confess a dump of its arguments.
mnemonic: You should confess all your sins before you sleep. zzzzzzzz
By default, XXX uses YAML.pm to dump your data. You can change this like so:
use XXX -with => 'Data::Dumper'; use XXX -with => 'YAML::XS'; use XXX -with => 'YAML::SomeOtherYamlModule';
Only modules with names beginning with 'YAML' and the Data::Dumper module are supported.
If you need to load XXX with require, you can set the dumper module with the $XXX::DumpModule global variable.
require
$XXX::DumpModule
require XXX; $XXX::DumpModule = 'YAML::Syck'; XXX::XXX($variable);
If you call a debugging function that calls XXX for you, XXX will print the wrong file and line number. To force XXX to skip a package in the call stack, just define the XXX_skip constant like this:
XXX_skip
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.
Ingy döt Net <ingy@cpan.org>
Copyright (c) 2006, 2008, 2010-2011. 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
To install XXX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XXX
CPAN shell
perl -MCPAN -e shell install XXX
For more information on module installation, please visit the detailed CPAN module installation guide.