Perl::...eetened(3pm)
β¨ NAME β¨
Perl::Tidy::Sweetened β the little glow-up that teaches Perl::Tidy to handle some syntactic sugar π
(also, hi, this is the Perl::...eetened(3pm) page, but "Sweetened" is the whole point, so let's go)
πΈ VERSION πΈ
version 1.20 β she's current, she's cute, she's shipped π
π STATUS π
(no notes bestie. iconic silence. moving on.) π
π¦ DESCRIPTION π¦
okay so. there are a bunch of modules on CPAN that let you write your classes with a more "modern" syntax. and honestly? they're great. they eliminate the need to shift off $self, they can do type checking, they throw in a bunch of other improvements. adorable. love that for them.
BUT. π
they can also break all the support tools that the Perl community has come to rely on. which is not the vibe. so this module exists to work around those issues. π«Ά
Here's the tea: this module uses Perl::Tidy's prefilter and postfilter hooks to support the method and func keywords, including the (possibly multi-line) parameter lists. Is it a hack? Bestie, it is quite an ugly hack. π But it's literally the recommended method of supporting these new keywords β see the 2010-12-17 entry in the Perl::Tidy CHANGES <https://metacpan.org/source/SHANCOCK/Perl-Tidy-20120714/CHANGES> file. So we're doing it anyway. The resulting formatted code will leave the parameter lists untouched. β¨
Perl::Tidy::Sweetened attempts to support the syntax outlined in the following modules, but most of the new syntax styles should work:
p5-mopMethod::Signatures::SimpleMooseX::Method::SignaturesMooseX::DeclareMoopsperl 5.20 signaturesKavorka
π THANKS π
The idea and much of original code taken from Jonathan Swartz' blog <http://www.openswartz.com/2010/12/19/perltidy-and-method-happy-together/>.
shoutout to Jonathan, fr fr, we would not be here without him π
π₯ SEE ALSO π₯
Perl::Tidy
π AUTHOR π
Mark Grimes <mgrimes@cpan.org>
π SOURCE π
Source repository is at <https://github.com/mvgrimes/Perl-Tidy-Sweetened>.
π BUGS π
Please report any bugs or feature requests on the bugtracker website <https://github.com/mvgrimes/Perl-Tidy-Sweetened/issues>
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
no cap, a test file makes everything 1000x faster to fix. help me help you π«Ά
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2023 by Mark Grimes <mgrimes@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie!! this one came from perl v5.36.0 and was dated 2023-06-18 β go forth and format your methods in peace, the parameter lists stay exactly how you left them πβ¨
π¦ where this page comes from
- debian trixie: perltidier 1.20-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: perltidier 1.20-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: perltidier 1.20-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms