Text::...::Star(3pm)
β¨ NAME β¨
Text::Xslate::Bridge::Star β it's the little bridge module that hands your templates a whole glow-up of common utilities, bestie π (and yes, the man page header shortens it to Text::...::Star(3pm), she's mysterious like that π
)
πΈ SYNOPSIS πΈ
use Text::Xslate;
my $tx = Text::Xslate->new(
module => ['Text::Xslate::Bridge::Star'],
);
okay so you literally just drop the module name into the module array and boom, the utilities show up in your templates. no cap π«Ά
π¦ DESCRIPTION π¦
This module gives you a curated lil selection of utilities for templates. that's the whole vibe. β¨
π FUNCTIONS π
π lc($str)
Returns a lower-cased version of $str. Same energy as CORE::lc(), but with one iconic twist: it returns undef if $str is undef. periodt π
See "lc" in perldoc for details.
π uc($str)
Returns a upper-cased version of $str. Same as CORE::uc(), except it returns undef if $str is undef. she is NOT about to crash on you fr fr π«Ά
See "uc" in perldoc for details.
π "substr($str, $offset, $len)"
Extracts a substring out of $str and returns it. Identical to CORE::substr(), but returns undef if $str is undef. lowkey so polite of her πΈ
See "substr" in perldoc for details.
π "sprintf($fmt, args...)"
Returns a string formatted by CORE::sprintf(). Heads up though bestie: $fmt must be a defined value. β οΈ
See "sprintf" in perldoc for details.
π rx($regex_pattern)
Compiles $regex_patter as a regular expression and returns the regex object. you can then pass that regex object to match() or replace() (they're right below, keep scrolling π). basically the same thing as the "qr//" operator in Perl. iconic. π₯
(yes the original says$regex_patterwith nonat the end β we don't fix it, we respect it, she's doing her best π)
π "match($str, $pattern)"
Tests if $str matches $pattern. $pattern may be a string or a regex object. π
It's giving $str =~ $pattern in Perl, but you have to pass a regex object explicitly if you can use regular expressions.
Examples, bc examples eat every single time π:
: match("foo bar baz", "foo") ? "true" : "false" # true
: match("foo bar baz", "f..") ? "true" : "false" # false
: match("foo bar baz", rx("f..")) ? "true" : "false" # true
π "replace($str, $pattern, $replacement)"
Replaces all the $patterns in $str with $replacements. Like $str =~ s/$pattern/$replacement/g but again β you have to pass a regex object explicitly if you can use regular expressions. it's the rule, she's strict, she's right β¨
π "split($str [, $pattern [, $limit]])"
Splits the string $str into a list of strings and returns the list. that's it, that's the function, she's simple and she's thriving π
π SEE ALSO π
Text::XslateText::Xslate::Bridgeperlfunc
and that's the whole page bestie!! πβ¨ this was perl v5.42.3, dated 2026-08-22, straight out of the User Contributed Perl Documentation vault. go forth and template, you absolute main character ππ¦π
π¦ where this page comes from
- ubuntu stonking: libtext-xslate-perl 3.5.9-2build2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms