Data::P...e::JSON(3)

✨ NAME ✨

Data::Printer::Profile::JSON β€” dump variables in JSON format. Okay bestie, this is the Data::P...e::JSON(3) page (User Contributed Perl Documentation, hiii πŸ‘‹), and it is literally all about yeeting your variables into JSON πŸ’…

🌸 SYNOPSIS 🌸

While loading Data::Printer:

use DDP profile => 'JSON';

While asking for a print:

p $var, profile => 'JSON';

or in your .dataprinter file:

profile = JSON

πŸ’– DESCRIPTION πŸ’–

This profile outputs your variables in JSON format. It's not nearly as efficient as a regular JSON module, but it may be useful β€” specially if you're changing the format directly in your .dataprinter ✨

πŸ¦‹ CAVEATS πŸ¦‹

JSON is, like, a super simple format β€” it allows scalar, hashes and arrays, periodt πŸ“ It has zero support for a bunch of types that could show up on Perl data structures, such as functions, globs and circular references. When printing those types, this module will stringify the result whenever possible.

Objects also don't get shown, but their internal data structure is exposed πŸ‘€

This module also tries to render Regular expressions as plain JS regexes. That's not directly supported in JSON, but it should be parseable 🧚

🌈 SEE ALSO 🌈

  • Data::Printer
  • JSON::MaybeXS> β€” and yes, the original SEE ALSO line is literally Data::Printer JSON::MaybeXS> with that trailing >, bestie, iykyk 😭

Signing off from the footer, bestie: perl v5.42.0, dated 2024-01-23, and yep β€” Data::P...e::JSON(3) one more time for the vibe check πŸ’‹πŸŽ€

πŸ“¦ where this page comes from