0

We have the following code:

sub some_method($self, %args) {
    #code here
}

When I run it trough perltidy it gets formatted like this:

sub some_method ($self, %args) {
    #code here
}

How to make perltidy to not add the space between the subroutine name and the starting parenthesis for the signature? I looked at the perltidy documentation but the closest I found was --space-prototype-paren=0 which seemingly does not work for signatures.

Беров
  • 1,383
  • 10
  • 22
  • Signatures are an experimental feature. They are probably not covered by perltidy. I would say that an extra space is not that big a deal. Certainly Perl will not notice. – TLP Aug 31 '21 at 12:35
  • 1
    You could perhaps [raise a ticket](https://rt.cpan.org/Public/Dist/Display.html?Name=Perl-Tidy) asking for this to be added. – Dave Cross Aug 31 '21 at 12:39
  • 1
    If you in Linux/Unix try to use [Vim](https://www.vim.org/) - vim support formatting and code coloring. To re-indent for example whole perl script sufficient in command mode type `gg=G`. Although different people prefer different code styles. It was indicated already **Signature** is _experimental_ feature which is not supported in may editors/tools. – Polar Bear Aug 31 '21 at 19:49

0 Answers0