Dist::...hDumper(3pm)
π NAME π
okay so this is the Dist::...hDumper(3pm) page β User Contributed Perl Documentation, bestie, we're in the big leagues β and it's all about Dist::Zilla::Role::HashDumper, which is a role whose whole personality is dumping selected hash keys as a string. that's it. that's the job. π
β¨ VERSION β¨
this doc describes version 4.13 of Dist::Zilla::Role::HashDumper, and it was released December 17, 2017 as part of Dist-Zilla-Plugins-CJM version 6.000. yes she's a 2017 girlie and she still serves. periodt. π
πΈ DESCRIPTION πΈ
so here's the tea π β plugins that implement HashDumper get to call their very own extract_keys method to pull selected keys out of a hash and hand back a string that's suitable for injecting straight into Perl code. main character behavior, honestly.
they can also call the hash_as_string method to do the exact same thing but for an entire hash. whole thing. no keys left behind. π
π¦ METHODS π¦
extract_keys
my $string = $plugin->extract_keys($name, \%hash, @keys);
eval "%new_hash = ($string);";
ngl this one is the combo meal β it smooshes extract_keys_as_hash and hash_as_string together into one. it builds a string of properly quoted keys and values out of the selected keys in a hash.
β οΈ quick vibe check:\%hashis a reference, but@keysis not. do not come for me about it, that's just how it is.
the $name is used only in a log_debug message. that's literally its only job. it's giving supporting cast energy but we love her. π«Ά
if any key has no value (or its value is an empty hash or array ref), that key gets omitted from the list. if all the keys get omitted, you get the empty string back. otherwise, the result always ends with a comma. always. no cap. π₯
extract_keys_as_hash
my $hashref = $plugin->extract_keys_as_hash($name, \%hash, @keys);
this one constructs a hashref from the selected keys in a hash. (again: \%hash is a reference, @keys is not β same deal as above, bestie.) and again, $name is used only in a log_debug message.
if any key has no value (or its value is an empty hash or array ref) it gets omitted from the new hashref. and if every single key gets omitted, you get an empty hashref back. it's giving "we tried" π but honestly valid.
hash_as_string
my $string = $plugin->hash_as_string(\%hash);
eval "%new_hash = ($string);";
this constructs a string of properly quoted keys and values from a hash. if the hash is empty, the empty string is returned. otherwise, the result always ends with a comma. she's consistent like that. π
π CONFIGURATION AND ENVIRONMENT π
Dist::Zilla::Role::HashDumper requires no configuration files and no environment variables. zero setup, zero drama, just vibes. π§
β DEPENDENCIES β
just the one bestie: Data::Dumper. iconic of her honestly.
π INCOMPATIBILITIES π
none reported. we're unproblematic. β¨
π BUGS AND LIMITATIONS π
no bugs have been reported. she's clean, she's fresh, she's thriving. π
π AUTHOR π
Christopher J. Madsen "<perl AT cjmweb.net>"
please report any bugs or feature requests to "<bug-Dist-Zilla-Plugins-CJM AT rt.cpan.org>" or through the web interface at <http://rt.cpan.org/Public/Bug/Report.html?Queue=Dist-Zilla-Plugins-CJM>. he wants to hear from you, fr fr. π
you can follow or contribute to Dist-Zilla-Plugins-CJM's development at <https://github.com/madsen/dist-zilla-plugins-cjm>. go be a contributor, main character. π
π«Ά COPYRIGHT AND LICENSE π«Ά
this software is copyright (c) 2017 by Christopher J. Madsen.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay. π
π DISCLAIMER OF WARRANTY π
okay bestie, the next bit is in ALL CAPS on purpose β it's the actual legal text, so I'm keeping every word exactly as it is. don't let the sparkle emoji fool you, this part counts. π₯
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
and that's the whole page, bestie π this one's from perl v5.34.0, dated 2022-06-13, and it lives under the Dist::...hDumper(3pm) name. go forth and dump those hashes responsibly. π¦β¨
π¦ where this page comes from
- debian bookworm: libdist-zilla-plugins-cjm-perl 6.000-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdist-zilla-plugins-cjm-perl 6.000-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdist-zilla-plugins-cjm-perl 6.000-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdist-zilla-plugins-cjm-perl 6.000-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdist-zilla-plugins-cjm-perl 6.000-2 Β· 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