D - Provides utility functions to encode data and dump it to STDERR.
use utf8; # Export du and dw functions use D; # Reference data that contains decoded strings my $data = [{name => 'あ'}, {name => 'い'}]; # Encode all strings in reference data to UTF-8 and dump the reference data to STDERR du $data; # Encode all strings in reference data to cp932 and dump the reference data. dw $data; # Dump reference data to STDERR without encoding. dn $data;
D module provides utility functions to encode data and dump it to STDERR.
Export du and dw and dn functions. Don't conflict debug command such as 'p' because these function names are consist of two characters.
du
dw
dn
Encode all strings in reference data in du and dw function.
du is a short name of "dump UTF-8"
dw is a short name of "dump Windows cp932"
dn is a short name of "dump no encoding"
Onliner is useful. "useD;du $data;" or "useD;dw $data;" or "useD;dn $data;"
Use Dump method of Data::Dumper to dump data
Dump
Print line number and file name to STDERR
Keys of hash of dumped data is sorted.
Don't print "$VAR1 =" unlike Data::Dumper default.
Export du and dw and dn functions.
du $data;
Encode all strings in reference data to UTF-8 and dump the reference data to STDERR with file name and line number.
If the argument is not reference data such as a string, it is also dumped in the same way as reference data.
Encode all strings in reference data to cp932 and dump the reference data to STDERR with file name and line number.
Dump reference data to STDERR without encoding with file name and line number.
https://github.com/YoshiyukiItoh/D
Data::Dumper, Carp, Data::Recursive::Encode
yoshiyuki ito, <yoshiyuki.ito.biz@gmail.com>
Yuki Kimoto, <kimoto.yuki@gmail.com>
Copyright (C) 2019 by yoshi, Yuki Kimoto
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.08.7 or, at your option, any later version of Perl 5 you may have available.
To install D, copy and paste the appropriate command in to your terminal.
cpanm
cpanm D
CPAN shell
perl -MCPAN -e shell install D
For more information on module installation, please visit the detailed CPAN module installation guide.