A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Don't indent so much

TL;DR: Don't indent over more than one page.

When programming, please factor your subroutines enough. One test for this is the level of indentation. If you find the code is indented for longer than one page (i.e. around 40-50 lines), then split that indented code out into its own subroutine.

This applies to loops, if-then statements, try-catch blocks, and given-when blocks. Especially when any combination of those are nested over several pages, it makes the code very difficult to follow.

Anything that indents the code indicates a logical grouping which you may find fits happily into a new subroutine. You can even give the subroutine a meaningful name which will serve as a signpost to future maintainers (not to mention a useful checkpoint to assert that variable contents are correct by validating the subroutine arguments).