Think about Loose Coupling | |
PerlMonks |
Re: Re: remove single blank lines?by hmerrill (Friar) |
on Dec 08, 2003 at 22:23 UTC ( [id://313276]=note: 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 Section
Seekers of Perl Wisdom
|
|