Templa...::Class(3pm)
π Templa...::Class β the manual, but make it cute π
okay bestie, so you're reading the Template::Plugin::Class(3pm) page from the User Contributed Perl Documentation section, and honestly? it's giving tiny-but-mighty. let's get into it π
β¨ NAME β¨
Template::Plugin::Class β the whole point is that it lets you call class methods on whatever arbitrary classes you want. no cap, that's it. π
πΈ SYNOPSIS πΈ
[% USE foo = Class('Foo') %]
[% foo.bar %]
that's the whole vibe. USE it, then call a method on it. slay. β¨
π¦ DESCRIPTION π¦
so Template::Plugin::Class lets you call class methods on arbitrary classes. that's the tea. π΅
one place this eats? Class::DBI-style applications, where you might do something like this:
[% USE cd = Class('Music::CD') %]
[% FOREACH disc = cd.retrieve_all %]
[% disc.artist %] - [% disc.title %]
[% END %]
iconic, honestly. loop over your CDs, print artist and title, done. main character energy fr fr πΏβ¨
π CAVEATS π
okay so there's one lil thing. you will not be able to directly call AUTOLOAD or DESTROY methods on the remote class. π
this shouldn't be a huge hardship. the manpage said it, not me, but it's true.
so likeβ¦ don't come for those two specifically. everything else? go off. π
π BUGS π
apart from that caveat we just talked about, none currently known. zero. zilch. clean sheet. β¨
if you do find any, please contact the author. they wanna know, bestie. π«Ά
π AUTHOR π
Richard Clamp <richardc@unixbeard.net>
(icon. legend. the moment. π)
π COPYRIGHT π
Copyright (C) 2003, 2004, 2006, 2009 Richard Clamp. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
so like, yes, go forth and redistribute, just keep it under the same terms as Perl itself. legal slay. βοΈπ
π SEE ALSO π
Template
go read that one too, it's the parent vibe iykyk π
and that's the page, bestie!! π this lil writeup is perl v5.34.0, dated 2022-06-17, and it lives at Templa...::Class(3pm). mwah, go call some class methods π
β¨
π¦ where this page comes from
- debian bookworm: libtemplate-plugin-class-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtemplate-plugin-class-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtemplate-plugin-class-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtemplate-plugin-class-perl 0.14-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtemplate-plugin-class-perl 0.14-2 Β· 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