HTML::...Classic(3pm)

πŸ“¦
version 1.003 Β· 2 versions
  • 1.003 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.003 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

HTML::Template::Compiled::Classic β€” bestie, this one gives you the classic functionality, exactly like HTML::Template πŸ’–


🌸 SYNOPSIS 🌸

use HTML::Template::Compiled::Classic compatible => 1;
my $htcc = HTML::Template::Compiled::Classic->new(
    # usual parameters for HTML::Template::Compiled
);

okay so literally just that. the compatible => 1 is the moment, iykyk πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this class hands you the features that can't coexist with the regular HTML::Template::Compiled features. like, you gotta pick a lane, bestie. here's the tea:

πŸŽ€ dots in TMPL_VARs

if you wanna use

<TMPL_VAR NAME="some.var.with.dots">

then you cannot use the dot-feature

<TMPL_VAR NAME="some.hash.keys">

at the same time. nope. it's giving "one or the other", fr fr 😭

🫢 Subref variables

in HTML::Template, this works:

my $ht = HTML::Template->new(
    scalarref => \"<TMPL_VAR foo>",
);
$ht->param(foo => sub { return "bar" });
print $ht->output; # prints 'bar'

this doesn't work in HTML::Template::Compiled tho. and listen β€” in the past it did, but as of HTC version 0.70 it won't any more. sorry bestie, they really said "no πŸ’€"


πŸ‘‘ METHODS πŸ‘‘

  • compiler_class β€” returns HTML::Template::Compiled::Compiler::Classic. that's it, that's the whole method, slay ✨
  • validate_var β€” gets the var name (parsed out of "NAME="foo.bar"") and returns if the string is a valid var name. vibe check on your variable names, basically 🌈

πŸ’œ SEE ALSO πŸ’œ

ngl there's nothing else listed here, so go forth and template, my love 🌸


that's the whole page, babe β€” perl v5.36.0, dated 2022-11-19, from the HTML::...Classic(3pm) era of User Contributed Perl Documentation. iconic, no cap πŸ’…βœ¨

πŸ“¦ where this page comes from