Templa...::POSIX(3pm)
β¨ Template::Plugin::POSIX π
okay bestie, welcome to the Template::Plugin::POSIX page β it's a TT2 plugin that imports POSIX functions, and yes it lives in the User Contributed Perl Documentation corner of the perl manual, we love that for it π«Ά
πΈ NAME πΈ
Template::Plugin::POSIX β the TT2 plugin that lets you import POSIX functions, no cap π
π VERSION π
This doc describes Template::Plugin::POSIX 0.05, which dropped on 12 March, 2007. vintage but iconic, fr fr β
β¨ SYNOPSIS β¨
[% USE POSIX %]
[% POSIX.log(100) %]
[% POSIX.rand(1) %]
[% POSIX.exp(2) %]
[% POSIX.sprintf("%.0f", 3.5) %]
[% POSIX.pow(2, 3) %]
[% POSIX.ceil(3.8) %]
[% POSIX.floor(3.8) %]
[% POSIX.sin(3.14) %]
[% POSIX.cos(0) %]
literally just USE POSIX and the whole function buffet opens up π
π DESCRIPTION π
So like β as a TT programmer, the author found the Template Toolkit's presentation language kinda inflexible, because the vocabulary was very limited π. So they wrote this little plugin to open a whole window from the template file into the full richness of most POSIX functions, which lowkey turns the Template language into a "programming language" in a much more serious sense. main character energy tbh π
Please keep in mind β and this is the important part, don't skip it β they just used AUTOLOAD, eval, and Data::Dumper to do the magic here πͺ
If you're looking for even more functions, they suggest you take a look at the Template::Plugin::Perl module, which exports the excellent POSIX repertoire. iykyk π
π¦ METHODS π¦
newβ the constructor, called by the TT2 template system πΌthrowβ the TT2 exception handling procedure π¨
π TODO π
- Add more unit tests. (yes bestie, that's the whole list π)
π SOURCE CONTROL π
You can always get the latest version of the source code from the following Subversion repository:
<http://svn.openfoundry.org/ttposix>
There is anonymous access to all of it π«Ά
If you'd like a commit bit, please let them know :) β¨
π AUTHOR π
Agent Zhang, <agentzh@gmail.com> π
π COPYRIGHT AND LICENSE π
Copyright (c) 2005, 2006, 2007 by Agent Zhang. All rights reserved. π
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. periodt πΈ
π SEE ALSO π
TemplateTemplate::Plugin::PerlData::Dumper
and that's the whole vibe check bestie β this page is from perl v5.32.0, dated 2021-01-06, and you absolutely ate for reading all the way to the end π ππ
π¦ where this page comes from
- debian bookworm: libtemplate-plugin-posix-perl 0.05-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtemplate-plugin-posix-perl 0.05-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libtemplate-plugin-posix-perl 0.05-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtemplate-plugin-posix-perl 0.05-1.1 Β· 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