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-mop
  • Method::Signatures::Simple
  • MooseX::Method::Signatures
  • MooseX::Declare
  • Moops
  • perl 5.20 signatures
  • Kavorka

πŸŽ€ 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 🫢

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