in reply to perltidy breaking before '=' ?

This strikes me as a rather nit-picky detail, but I can understand why you would want this behavior. The question is: is it only this sort of statement that is making trouble for you? If so, how bad is it just to edit perltidy's output yourself to fix these cases? Or, if there are a lot of these, and they all end up following the same basic pattern, why not try an ad-hoc filter on the perltidy output -- something like:
s/^(\s*)(my\s+[^\s=]+)\s*(=[^;]+)$/$1$2\n$1 $3/;
For lines that look like  my $var = ... and lack a semi-colon on the rhs, this substitution will put any indentation that precedes "my", plus another four spaces of indentation, at the beginning of a new line that holds just the "= ..." portion.

Replies are listed 'Best First'.
Re^2: perltidy breaking before '=' ?
by shenme (Priest) on Sep 16, 2006 at 18:50 UTC
    If so, how bad is it just to edit perltidy's output yourself to fix these cases?

    As I understand it, the ideal is to use Perltidy quite often, as one part of the edit cycle, cleaning up any unintentional goofs and restoring to the 'standard' formatting. Perltidy is not a one-time or once-a-month thing, rather it is supposed to be done at least before each time you check your changes back into the repository.

    So you shouldn't have to clean up after the cleaner-upper. Indeed, it is this problem that has so far kept me from using Perltidy as intended.