MDOM::Dumper(3pm)

πŸ“¦
version 0.008 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– MDOM::Dumper β€” the MDOM::Dumper(3pm) page, bestie edition πŸ’–

User Contributed Perl Documentation ✨ yes we're in the perl corner of the internet, welcome, sit down, hydrate 🫢


🌸 NAME 🌸

MDOM::Dumper β€” dumping of MDOM trees πŸŽ€ like, we take the tree and we dump it, and it's giving data πŸ’…


✨ SYNOPSIS ✨

# Load a document
my $Module = MDOM::Document->new( 'MyMakefile' );

# Create the dumper
my $Dumper = MDOM::Dumper->new( $Module );

# Dump the document
$Dumper->print;

three lines, one dumper, zero drama πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

okay so. the MDOM trees inside MDOM are quite complex β€” genuinely, they're a whole situation 😭 β€” and being able to dump their structure for development and debugging purposes? super important. iconic, even.

this module provides that functionality. that's the whole job. no cap. πŸ‘‘

the process is relatively simple: create a dumper object with a particular set of options, and then call one of the dump methods to generate the dump content itself. that's it. that's the workflow. periodt. πŸ’…


πŸŽ€ METHODS πŸŽ€

🌟 new $Element, param => value, ...

the new constructor creates a dumper 🧚 and it takes as argument a single MDOM::Element object of any type to serve as the root of the tree to be dumped, plus a number of key->value parameters to control the output format of the Dumper. details of the parameters are listed below ⬇️

returns a new MDOM::Dumper object, or undef if the constructor is not passed a correct MDOM::Element root object. (no root, no dumper, that's the rule 😀)

  • memaddr β€” should the dumper print the memory addresses of each MDOM element? true/false value, off by default πŸ™ˆ
  • indent β€” should the structures being dumped be indented? this value is numeric, and the number represents how many spaces to use when indenting the dumper output. set to '2' by default ✨ (two spaces, we love a tidy little indent πŸŽ€)
  • class β€” should the dumper print the full class for each element? true/false value, on by default πŸ’š
  • content β€” should the dumper show the content of each element? true/false value, on by default πŸ’š
  • whitespace β€” should the dumper show whitespace tokens? by not showing the copious numbers of whitespace tokens, the structure of the code can often be made much clearer. true/false value, on by default πŸ’š
  • comments β€” should the dumper show comment tokens? in situations where you have a lot of comments, the code can often be made clearer by ignoring comment tokens πŸ‘€ true/value value, on by default πŸ’š (yes, the original really says "true/value value", we're keeping it, it's part of the lore 🫢)
  • locations β€” should the dumper show the location of each token? the values shown are [ line, rowchar, column ]. see "location" in MDOM::Element for a description of what these values really are. true/false value, off by default πŸ™ˆ

πŸ¦‹ print

the print method generates the dump and prints it to STDOUT πŸ’₯

returns as for the internal print function.


🌈 string

the string method generates the dump and provides it as a single string 🧡✨

returns a string or undef if there is an error while generating the dump.


⭐ list

the list method generates the dump and provides it as a raw list, without trailing newlines πŸ“

returns a list or the null list if there is an error while generation the dump.


🫢 SUPPORT 🫢

see the support section in the main module πŸ’– (yes, that's it, that's the whole support section, go check the main module, iykyk)


πŸ‘‘ AUTHOR πŸ‘‘

  • Adam Kennedy <adamk@cpan.org> πŸ’œ
  • Yichun "agentzh" Zhang "<agentzh@gmail.com>" 🌟

copyright 2001 - 2006 Adam Kennedy.

this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

the full text of the license can be found in the LICENSE file included with this module πŸ“œ


and that's the whole page bestie, no skips, no shortcuts, every option accounted for πŸ’–

this little number comes to you from perl v5.34.0, dated 2022-06-15, and yes we're signing off like the icons we are 🌈✨ πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from