<i>Decent editors do automatic indentation anyway of course, but there are often circumstances (especially in Perl, where even GNU emacs can't always parse the syntax correctly) when they don't do the right thing.</i><p>I have been working on cperl-mode's indentation recently, and think it gets indentation right in 99.9% of cases.  If you encounter that 0.1% case, you should submit a bug report here:<p><a href="http://github.com/jrockway/cperl-mode/issues" rel="nofollow">http://github.com/jrockway/cperl-mode/issues</a><p>(Keep in mind that indentation is highly customizable, so you probably just need to flip some switches to get what you want.)