Text::...::Util(3pm)

✨ Text::Xslate::Util β€” the manual, but make it cute ✨

okay bestie, so this is Text::...::Util(3pm), straight outta the User Contributed Perl Documentation collection. It's the little utility drawer that comes with Xslate, and honestly? it's giving "small but mighty" πŸ’…


🌸 NAME 🌸

Text::Xslate::Util β€” a whole set of utilities for Xslate, no cap πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

here's the vibe, literally just:

use Text::Xslate::Util qw(
    mark_raw
    unmark_raw
    html_escape
    uri_escape
    p
    html_builder
    hash_with_default
);

slay. that's the whole import list, right there. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

This module provides utilities for Xslate. That's it, that's the description β€” it's a toolbox, and the tools are down below. 🧰✨


πŸ’– INTERFACE πŸ’–

🌈 Exportable functions 🌈

these are the ones you can pull into your own namespace with use. let's go one by one, bestie:

  • mark_raw($str) β€” this is the actual entity (the real deal, the implementation) behind the mark_raw filter. 🫢
  • unmark_raw($str) β€” same energy, but for the unmark_raw filter. this is the entity of it. πŸ’œ
  • html_escape($str) β€” yep, you guessed it, this is the entity of the html_escape filter. ✨
  • uri_escape($str) β€” and this one is the entity of the uri filter. (not uri_escape, the uri filter β€” look, I just report the facts, okay 😭)
  • p($any) / dump($any) β€” this one displays the contents of $any using Data::Dumper. πŸ“¦πŸ” It's the entity of the dump filter, and it is so useful for debugging. honestly my go-to when something's acting sus.
  • html_builder { block } | \&function :CodeRef β€” this wraps a block or a &function with mark_raw so that the brand-new subroutine returns a raw string. 🎁✨ Basically: you hand it something, it comes back raw. This function is the same as what Text::Xslate exports.
  • hash_with_default \%hash, $default :Any β€” sets a default value $default onto %hash and returns a HashRef. πŸ”‘ This one is provided for debugging, so it's lowkey a helper, not a production flex.
ngl, several of these are literally "the entity of" an Xslate filter β€” that's the whole point. The filter in your template, the function in your Perl? Same soul. 🫢

πŸ‘€ SEE ALSO πŸ‘€

  • Text::Xslate β€” go read it, bestie, it's the main character here 🏰

and that's a wrap on the page 🎬 this gem ships as part of perl v5.42.3, dated 2026-08-22, and it lives under the very iconic name Text::...::Util(3pm). mwah, go debug something pretty πŸ’‹πŸ’–

πŸ“¦ where this page comes from