Templa...:Stream(3pm)

πŸ“¦
version 1.022 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Template::Alloy::Stream β€” the perl 3pm page, bestie edition πŸ’–

okay so you opened Template::Alloy::Stream(3pm) from the User Contributed Perl Documentation section and you're like "what is this" β€” don't worry, I got you. this is the page for the Stream role. it's lowkey iconic and highkey underrated. let's go 🫢


✨ NAME ✨

Template::Alloy::Stream β€” it's a Stream role, and what it does is let you play out the AST and print straight to a file handle. no buffering nonsense, just vibes ✨


🌸 DESCRIPTION 🌸

so Template::Alloy::Stream is a role that works similar to the PLAY role, except β€” and this is the whole point, bestie β€” instead of accumulating the data, it prints it as soon as it is available. like it does not wait. it does not hoard. it just sends it. main character energy fr πŸ’…

  • All directives are supported β€” every single one β€” except the CLEAR directive, which is literally meaningless here. like girl, clear what? there's nothing being held. 🫠
  • Most configuration items are supported β€” except the TRIM directive. and no, it's not a bug, it's because the output is not buffered into a variable, so there's genuinely nothing to trim. can't trim what you never kept, periodt.
  • The WRAPPER directive is still supported πŸŽ‰ but heads up β€” it essentially turns off STREAM, because the content has to be generated before playing the WRAPPER templates. so the whole "print it immediately" thing? yeah, that's on pause while wrapper does its thing. the way that wrapper just takes over... πŸ™ˆ
ngl this is the tradeoff of the whole role: you get instant output, but instant output means some things (trimming, clearing) just don't have anything to work with. no cap.

πŸ¦‹ ROLE METHODS πŸ¦‹

⭐ stream_tree

Similar to play_tree from the Play role β€” but it prints output to the screen as soon as it is ready. that's it, that's the method, and it ate πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

Paul Seamons <paul@seamons.com> β€” thank you for your service, legend πŸ«‘πŸ’œ


πŸŽ€ LICENSE πŸŽ€

This module may be distributed under the same terms as Perl itself. slay, that's the good license. πŸ“


and that's the whole page, bestie!! this was Template::Alloy::Stream, part of the User Contributed Perl Documentation, and it's living in perl v5.38.2, dated 2024-03-07. mwah, go stream something πŸ’–βœ¨πŸ§š

πŸ“¦ where this page comes from