Text::...Bridge(3pm)
π Text::Xslate::Bridge β the interface base class to import methods π
okay bestie, so like. this page is Text::...Bridge(3pm), and it lives in the User Contributed Perl Documentation section of the manual, which honestly? iconic of it. let's get into it β¨
πΈ SYNOPSIS πΈ
here's the whole vibe up front, no cap:
package SomeTemplate::Bridge::Xslate;
use parent qw(Text::Xslate::Bridge);
__PACKAGE__->bridge(
nil => \%nil_methods,
scalar => \%scalar_methods,
array => \%array_methods,
hash => \%hash_methods,
function => \%functions,
);
# in your script
use Text::Xslate;
my $tx = Text::Xslate->new(
module => [
'SomeTemplate::Bridge::Xslate'
=> [-exclude => [qw(hash::keys hash::values)]],
],
);
likeβ¦ look at her. subclassing, bridging, excluding a couple of hash:: methods like she's curating a playlist. main character energy fr fr π
π¦ DESCRIPTION π¦
okay so this module? it's literally the base class for adaptor classes. that's the whole job description. she's the blueprint, the mother of bridges, the one everyone else use parents. periodt. π
β¨ INTERFACE β¨
π "__PACKAGE__->bridge(@mapping) :Void"
this is the one move you gotta know. calling bridge on your package installs a bridge module that has the methods in @mapping. π«
and if you want an actual working example instead of my yapping? go look at example/bridge.pl. it's right there. go. look. π«Ά
ngl the signature says :Void, so don't go expecting a return value to use, bestie β it's giving "does the thing and leaves." π
π SEE ALSO π
the whole friend group, gathered:
Text::XslateText::Xslate::Bridge::TT2Text::Xslate::Bridge::TT2LikeText::Xslate::Bridge::Alloy
go say hi π they're all part of the family.
π and that's the tea! this page ships with perl v5.42.3, dated 2026-08-22, and it's Text::...Bridge(3pm) β so next time you're bridging methods, you know exactly where to come. slay, stay hydrated, and may your bridges never segfault. β¨ππ¦
π¦ 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