HTML::...::Lazy(3pm)
β¨ NAME β¨
HTML::Template::Compiled::Lazy β Lazy Loading for HTML::Template::Compiled π
okay so bestie, this is the 3pm manual page for HTML::...::Lazy, and it's giving exactly what it says on the tin: lazy loading, but make it iconic π¦
πΈ SYNOPSIS πΈ
use HTML::Template::Compiled::Lazy;
my $htcl = HTML::Template::Compiled::Lazy->new(
# usual parameters for HTML::Template::Compiled
);
$htcl->param(...);
# file wasn't compiled yet
print $htcl->output; # now compile and output!
see how it just sits there being all chill? π you set your params, you vibe, and nothing has happened yet. the compiling is on a whole other schedule, fr fr.
π DESCRIPTION π
so the way this class works is: it does not compile templates before you call output(). like, at all. and yes, that includes TMPL_INCLUDEs β those get the same treatment. no cap π
this can be useful in CGI environments, and here's the tea: if your template has got a lot of includes, HTML::Template::Compiled will compile all of them, even if they aren't needed because they are never reached (in a TMPL_IF, for example). literally compiling stuff you will never even look at?? wasted effort bestie, we don't do that here π«Ά
also, HTML::Template::Compiled::Lazy won't complain if the file does not exist β it will complain when you call output(), though. so the drama is just delayed, not cancelled π
so yeah, that's the whole vibe: defer the work, dodge the pointless compiles, and let the errors show up fashionably late. slay β¨
this page is from the User Contributed Perl Documentation, brought to you by perl v5.36.0, dated 2022-11-19. mwah, take care of her πππ¦
π¦ where this page comes from
- debian bookworm: libhtml-template-compiled-perl 1.003-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhtml-template-compiled-perl 1.003-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-template-compiled-perl 1.003-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-template-compiled-perl 1.003-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-template-compiled-perl 1.003-3 Β· 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