perlpunk / YAML-PP-p5

A YAML 1.2 processor in perl
https://metacpan.org/pod/YAML::PP
24 stars 8 forks source link

Suggestion: shorter alias for YAML::PP::Highlight #34

Closed atoomic closed 4 years ago

atoomic commented 4 years ago

This is just a suggestion, not a bug report.

YAML::PP::Highlight is great but I would really enjoy using a shorter alias, maybe YPH, to add it at a lower cost when debugging?

perlpunk commented 4 years ago

Thanks. Do you mean an exported function, or do you mean as a module name, so you can do use YPH?

I think there is an alternative for you: https://metacpan.org/release/XXX

It has several debugging functions, and if you load it via commandline -MXXX, then you still have a relatively short name even when using the full package name:

XXX::XXX(\%data);
XXX::YYY(\%data);

The cool thing is, you can choose the module for dumping: https://metacpan.org/pod/release/INGY/XXX-0.35/lib/XXX.pm#CONFIGURATION

In version 0.32 I added the possibility to choose the module via an environment variable, and I have set up an alias for this:

alias xxxcolor="export PERL_XXX_DUMPER=YAML::PP::Highlight"
alias xxxnocolor="export PERL_XXX_DUMPER=''"

So I can easily turn on colored highlighting when needed.

I didn't show this in the lightning talk because no time ;-)

atoomic commented 4 years ago

yes I was thinking as a module name so it's easy to plug and use the dirty way :-) XXX is an illustration of what I had in mind.

I think we can close this case and simply use XXX :-)

thanks @perlpunk, great talk at #TPCiC2020