Text::...Sprintf(3pm)

πŸ“¦
version 2.23 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸŽ€ Text::MicroMason::Sprintf β€” NAME πŸ’–

So this page is Text::...Sprintf(3pm), part of the User Contributed Perl Documentation, and the module itself is Text::MicroMason::Sprintf β€” the Formatted Interpolation Engine. bestie, that's the whole name section, we're moving. ✨


🌸 SYNOPSIS 🌸

okay so first thing, don't just use this class by itself, no ma'am β€” you pass its name in to get mixed in:

use Text::MicroMason;
my $mason = Text::MicroMason::Base->new( -Sprintf );

and then your templates can be written using Perl's sprintf interpolation syntax:

$coderef = $mason->compile( text => 'Hello %s' );
print $coderef->( 'World' );

it's giving Hello World and it's giving effortless. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

Text::MicroMason::Sprintf uses Perl's sprintf formatting syntax for templating. that's the vibe. that's the whole thing. πŸ¦‹

and like, obviously you don't need this module for simple cases of interpolation β€” nobody's saying you do β€” but if you're already using the MicroMason framework to process template files from disk, then this module should allow you to make your simplest templates run even faster. lowkey a glow-up for your pipeline. πŸ”₯

also! Perl's sprintf function supports traditional Unix-style sprintf() formatting as well as a number of very useful extensions. go consult "sprintf" in perlfuc for more details, iykyk. πŸ“–


πŸ¦‹ SEE ALSO πŸ¦‹

  • for an overview of this distribution, go look at Text::MicroMason πŸ’«
  • this is a subclass intended for use with Text::MicroMason::Base 🫢
  • for distribution, installation, support, copyright and license info, see Text::MicroMason::Docs::ReadMe πŸ“œ

no cap: every option, path and caveat up there is exactly as the original page had it. we do not edit the facts in this house. πŸ’€

okay bye bestie, this was perl v5.36.0, dated 2023-08-10 β€” thanks for reading the Text::...Sprintf(3pm) page, you ate. πŸ‘‘βœ¨

πŸ“¦ where this page comes from