Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

perltidy - no space before comment if first item in block

by larryk (Friar)
on Feb 23, 2005 at 16:36 UTC ( #433751=perlquestion: print w/replies, xml ) Need Help??
larryk has asked for the wisdom of the Perl Monks concerning the following question:

perltidy -bl -bbc is doing everything right but I want to negate its effect in one situation, namely the conversion of:

while ($foo) { # blah blah blah --$foo; }


while ($foo) { # blah blah blah --$foo; }

If the comment is the first item in a block, I don't want it to have a blank line inserted above (there's already enough new space generated above by -bl: braces left - not my personal choice btw!).

I have checked all the docs and SuperSearched and googled and am none the wiser - anyone done this before?


perl -le "s,,reverse killer,e,y,rifle,lycra,,print"

Replies are listed 'Best First'.
Re: perltidy - no space before comment if first item in block
by rir (Vicar) on Feb 23, 2005 at 20:15 UTC
    Not exactly what you want but -bl -nbbc -bbb may be more agreeable. Or -nsob to leave optional vertical white alone.

    T'were I fussy I'd alias perltidy to perltidy and a postprocessing script to handle this case.

    Be well,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://433751]
Approved by kvale
[davido]: I am not finding closing STDIN to be an adequate means of making getlogin return undef.
[Corion]: Maybe doing a double-fork (daemonizing) can make go that information away, but maybe not
[Corion]: But I think my knowledge of unix/Linux datastructures is several decades out of date, so I don't really know what information it keeps on processes
[oiskuu]: The useful bits that relate to your process can be found under /proc/self. What information are you thinking of? Tty name?
[tye]: I just daemonized and getlogin() still knew who I had been.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-06-23 19:32 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (554 votes). Check out past polls.