Pod::Tree::Pod(3pm)

πŸ“¦
version 1.31 Β· 2 versions
  • 1.31 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.31 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

Pod::Tree::Pod β€” bestie, this is the part where we take a Pod::Tree and turn it right back into POD. Yes, a full glow-up in reverse. (Oh and hi, the manual name is Pod::Tree::Pod(3pm), from the User Contributed Perl Documentation crew 🫢)


✨ SYNOPSIS ✨

okay so here's the whole vibe, copy-paste ready:

use Pod::Tree::Pod;

$tree =  Pod::Tree->new;

$dest =  IO::File->new;
$dest = "file.pod";

$pod  =  Pod::Tree::Pod->new($tree, $dest);

$pod->translate;

like. that's it. that's the whole thing. slay πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Pod::Tree::Pod converts a Pod::Tree back to a POD. (yes, un-formatting it. the anti-glow-up. we love a round trip ✨)

The destination gets locked in the moment the object is created β€” like, it's decided, it's final, no take-backs. Then the translate method does the actual translation work. she's the one doing the heavy lifting, no cap.

For convenience (because we're nice like that πŸŽ€), Pod::Tree::Pod can write the POD to a variety of destinations. The new method is the one that figures out what $dest actually means.

🎯 Destination resolution

Pod::Tree::Pod can write HTML to either of 2 destinations. new resolves $dest by checking these things, in order:

  1. If $dest is a reference, then it is taken to be an IO::File object that is already open on the file where the POD will be written.
  2. If $dest is not a reference, then it is taken to be the name of the file where the POD will be written.
ngl the original page really does say "HTML" here. we're keeping it exactly as-is because facts stay facts, even when they're a little chaotic 😭

πŸ‘‘ METHODS πŸ‘‘

  • $pod = "new" "Pod::Tree::Pod" $tree, $dest β€” Creates a new Pod::Tree::Pod object.

$tree is a Pod::Tree object that represents a POD. $pod writes the POD to $dest. See "Destination resolution" for details. iykyk πŸ’œ

  • $pod->"translate" β€” Writes the text of the POD. This method should only be called once. fr fr, one and done, don't be out here calling it twice πŸ™ˆ

πŸ’€ DIAGNOSTICS πŸ’€

  • Pod::Tree::Pod::new: not enough arguments β€” (F) new called with fewer than 2 arguments. bestie she needs TWO things minimum, she cannot work with less 😭
  • Pod::Tree::HTML::new: Can't open $dest: $! β€” (F) The destination file couldn't be opened. the file said no 🚫

⭐ NOTES ⭐

  • The destination doesn't actually have to be an IO::File object. It may be any object that has a print method. flexible queen energy πŸ‘‘

🌈 SEE ALSO 🌈

perl(1), "Pod::Tree", "Pod::Tree::Node" β€” go read those next, they're the supporting cast 🫢


πŸ“ AUTHOR πŸ“

Steven McDougall, swmcd@world.std.com


Copyright (c) 2000-2003 by Steven McDougall. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie!! πŸ’…βœ¨ this was Pod::Tree::Pod(3pm) from perl v5.36.0, dated 2022-11-19 β€” literally iconic, no notes, periodt πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from