Perl::Tidy::Sweet - Tweaks to Perl::Tidy to support some syntactic sugar
version 1.03
There are a number of modules on CPAN that allow users to write their classes with a more "modern" syntax. These tools eliminate the need to shift off $self, can support type checking and offer other improvements. Unfortunately, they can break the support tools that the Perl community has come to rely on. This module attempts to work around those issues.
$self
The module uses Perl::Tidy's prefilter and postfilter hooks to support method and func keywords, including the (possibly multi-line) parameter lists. This is quite an ugly hack, but it is the recommended method of supporting these new keywords (see the 2010-12-17 entry in the Perl::Tidy CHANGES file). The resulting formatted code will leave the parameter lists untouched.
prefilter
postfilter
method
func
Perl::Tidy::Sweetened attempts to support the syntax outlined in the following modules, but most of the new syntax styles should work:
Perl::Tidy::Sweetened
p5-mop
Method::Signatures::Simple
MooseX::Method::Signatures
MooseX::Declare
Perl::Tidy
The idea and much of original code taken from Jonathan Swartz' blog.
Kent Fredric refactored the code into the pluggable architecture. Very nice work, thank you.
Please report any bugs or suggestions at http://rt.cpan.org/NoAuth/Bugs.html?Dist=Perl-Tidy-Sweetened
Mark Grimes, <mgrimes@cpan.org>
This software is copyright (c) 2014 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.
To install Perl::Tidy::Sweetened, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Tidy::Sweetened
CPAN shell
perl -MCPAN -e shell install Perl::Tidy::Sweetened
For more information on module installation, please visit the detailed CPAN module installation guide.