P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
That may work, but that regex hurts my head. The only way I would use that code is if it were commented well as to what each part of the regex does - even then I might not use it.
A much clearer, albeit more code and more steps method, would be to: This method would allow you to read ahead one (or more than one) line to see if there are 2 more more blank lines together. Just my preference, but IMHO much clearer than trying to decifer that regex. My choice is to always make my code as understandable to *everyone* (including newbies) as possible. Obfuscated regex's do more to scare people away from Perl. Just my 2c. HTH. In reply to Re: Re: remove single blank lines?
by hmerrill
|
|