Tips for Using Perltidy

Filed Under Perl | 

Things I’ve learned about perltidy.

When returning a hashref from a subroutine, make sure to explicitly give the ‘return’ command, or else perltidy will get confused, think it’s a bare block, and format it strangely.

Similarly, if the last statement of a script is complex, with nested subrefs etc, adding the trailing semicolon can change how perltidy indents the code quite significantly…

Comments

Leave a Reply