Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: perltidy breaking before '=' ?

by graff (Chancellor)
on Sep 16, 2006 at 16:23 UTC ( [id://573352]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://573352]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-25 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found