Templa...::Class(3pm)

πŸ“¦
version 0.14 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 (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